Skip to content

Commit

Permalink
DAS-2254: Updates README. Adds CONTRIBUTING.
Browse files Browse the repository at this point in the history
- Adds ruff config to pyproject.toml
  • Loading branch information
flamingbear committed Nov 27, 2024
1 parent defb750 commit a3dbd8a
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 7 deletions.
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing to SMAP-L2-Gridding-Service

Thanks for contributing!

## Making Changes

To allow us to incorporate your changes, please use the
[Fork-and-Pull](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models#fork-and-pull-model)
development model:

1. Fork this repository to your personal account.
2. Create a branch and make your changes.
3. Test the changes locally/in your personal fork.
4. Submit a pull request to open a discussion about your proposed changes.
5. The maintainers will talk with you about it and decide to merge or request
additional changes.

For larger items, consider contacting the maintainers first to coordinate
development efforts.

## Commits

Our ticketing and CI/CD tools are configured to sync statuses amongst each
other. Commits play an important role in this process. Please start all commits
with the Jira ticket number associated with your feature, task, or bug. All
commit messages should follow the format
"[Jira Project]-XXXX - [Your commit message here]"

## General coding practices:

This repository adheres to Python coding style recommendations from
[PEP8](https://peps.python.org/pep-0008/). Additionally, type hints are
required in all function signatures.

When adding or updating functionality, please ensure unit tests are added to
an appropriate module in the `tests` sub directories, which cover each branch
of the code.

## Disclaimer

SMAP-L2-Gridding-Service maintainers will review all pull requests submitted. Only requests that
meet the standard of quality set forth by existing code, following the patterns
set forth by existing code, and adhering to existing design patterns will be
considered and/or accepted.

For general tips on open source contributions, see
[Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/).
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,53 @@

This repository contains the code for the SMAP-L2-Gridding-Service, which is a python service that transforms NASA level 2 gridded trajectory data into gridded NetCDF4-CF output files.

This code currently works on `SPL2SMP_E` data and will be adapted for other gridded trajectory data.
This code currently works on `SPL2SMP_E` data and will be adapted for other SMAP collections of gridded trajectory data.


## Transforming Data

The logic of transforming data is contained in the `smap_l2_gridder` directory. It reads NASA L2 Gridded trajectory data and writes output NetCDF-CF files with the trajecotry style data correctly populated into EASE2 grids.

### Commandline invocation
To run the regridder on an input file. Create an isolated python 3.12 environment using packages from the `pip_requirements.txt` file and then from the commandline run:

```python
python -m smap_l2_gridder --input path/to/granule.h5 --output path/to/output_granule.nc
```

## Transform Data
To run the regridder, first create an isolated python 3.12 environment using packages from the `pip_requirements.txt` file.
`smap_l2_gridder/__main__.py` is the entrypoint to the science logic module and can be used for testing and development.

From the commandline run:
## Directory structure

```python
python -m smap_l2_gridder --input path/to/granule.h5 --output path/to/output_granule.nc
```
πŸ“
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ πŸ“ bin
β”œβ”€β”€ πŸ“ docker
β”œβ”€β”€ πŸ“ harmony_service
β”œβ”€β”€ pip_requirements.txt
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ πŸ“ smap_l2_gridder
└── πŸ“ tests
```

* `CHANGELOG.md` - Contains a record of changes applied to each new release of the SMAP-L2-Gridding-Service.
* `CONTRIBUTING.md` - Instructions on how to contribute to the repository.
* `LICENSE` - Required for distribution under NASA open-source approval. Details conditions for use, reproduction and distribution.
* `README.md` - This file, containing guidance on developing the library and service.
* `bin` - A directory containing utility scripts to build the service and test images. A script to extract the release notes for the most recent version, as contained in `CHANGELOG.md` is also in this directory.
* `docker` - A directory containing the Dockerfiles for the service and test images. It also contains `service_version.txt`, which contains the semantic version number of the library and service image. Update this file with a new version to trigger a release.
* `harmony_service` - A directory containing the Harmony Service specific python code. `adapter.py` contains the `SMAPL2GridderAdapter` class that is invoked by calls to the Harmony service.
* `pip_requirements.txt` - Contains a list of python packages needed to run the service.
* `pyproject.toml` - Configuration file used by packaging tools, and other tools such as linters, type checkers, etc.
* `smap_l2_gridder` - Python package containing the logic for reformatting L2G data.
* `tests` - Contains the pytest test suite.


## pre-commit hooks:
## `pre-commit` hooks

This repository uses [pre-commit](https://pre-commit.com/) to enable pre-commit
checks that enforce coding standard best practices. These include:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[tool.ruff.format]
quote-style = "single"


[[tool.mypy.overrides]]
module = "harmony_service_lib.*"
Expand Down

0 comments on commit a3dbd8a

Please sign in to comment.