diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a49d08d --- /dev/null +++ b/CONTRIBUTING.md @@ -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/). diff --git a/README.md b/README.md index 3c9d3f6..9d55216 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 197e9af..f94992a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[tool.ruff.format] +quote-style = "single" + [[tool.mypy.overrides]] module = "harmony_service_lib.*"