Skip to content

Commit

Permalink
Merge pull request #10 from nsidc/cleanup-cdr-logic-from-pmicecon
Browse files Browse the repository at this point in the history
Cleanup duplicate CDR logic from `pm_icecon`
  • Loading branch information
trey-stafford authored Oct 19, 2023
2 parents fbe8d03 + 4bedc4f commit 9dcb667
Show file tree
Hide file tree
Showing 14 changed files with 109 additions and 738 deletions.
77 changes: 1 addition & 76 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,82 +46,7 @@ TODO

## Development/contributing

### For developers at NSIDC

For developers at NSIDC, the [seaice_ecdr_vm
repository](https://bitbucket.org/nsidc/seaice_ecdr_vm/src/main/) provides the
NSIDC VM configuration for this project.

An initial copy of the pm_icecon "cdr" generation can be executed from the VM directory:

`~/seaice_ecdr/`

using the cli.sh command:

```
./scripts/cli.sh bootstrap amsr2 --date 2022-08-01 --hemisphere north --output-dir /tmp/ --resolution 12
```

### Adding dependencies

To add new dependencies to this project, update the `environment.yml` file with
the new dependency. Then update your conda environment:

```
$ mamba env update
```

Once the conda environment has been updated, lock the environment using `conda-lock`:

```
$ conda-lock
```

Commit the changes for the `environment.yml` and the `conda-lock.yml` files.


### Running tests/CI

#### Linting / formatting
This project uses [pre-commit](https://pre-commit.com/) to run pre-commit hooks
that check and format this project's code for stylistic consistency (using
`ruff` and `black`) .

The pre-commit configuration for this project can be found in
`.pre-commit-config.yaml`. Configuration for specific tools (e.g., `mypy`) is
given in the included `pyproject.toml`.

For more information about using `pre-commit`, please sese the [Scientific
Python Library Development Guide's section on
pre-commit](https://learn.scientific-python.org/development/guides/gha-basic/#pre-commit).

To install pre-commit to run checks for each commit you make:

```
$ pre-commit install
```

To manually run the pre-commit hooks without a commit:

```
$ pre-commit run --all-files
```

#### Running unit tests

Use `pytest` to run unit tests:

```
$ python -m pytest
```

#### Type-checking

Use `mypy` to run static typechecking

```
$ mypy
```
See [doc/development.md](doc/development.md) for more information.

## License

Expand Down
22 changes: 0 additions & 22 deletions README_dev.txt

This file was deleted.

83 changes: 83 additions & 0 deletions doc/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
While developing at NSIDC, the workflow is:

### For developers at NSIDC

For developers at NSIDC, the [seaice_ecdr_vm
repository](https://bitbucket.org/nsidc/seaice_ecdr_vm/src/main/) provides the
NSIDC VM configuration for this project.

`pm_icecon`, `seaice_ecdr`, and `pm_tb_data` will be checked out to
`/home/vagrant/{project_name}`.

### Adding dependencies

To add new dependencies to this project, update the `environment.yml` file with
the new dependency. Then update your conda environment:

```
$ mamba env update
```

Once the conda environment has been updated, lock the environment using `conda-lock`:

```
$ conda-lock
```

Commit the changes for the `environment.yml` and the `conda-lock.yml` files.


### Running tests/CI

#### Linting / formatting
This project uses [pre-commit](https://pre-commit.com/) to run pre-commit hooks
that check and format this project's code for stylistic consistency (using
`ruff` and `black`) .

The pre-commit configuration for this project can be found in
`.pre-commit-config.yaml`. Configuration for specific tools (e.g., `mypy`) is
given in the included `pyproject.toml`.

For more information about using `pre-commit`, please sese the [Scientific
Python Library Development Guide's section on
pre-commit](https://learn.scientific-python.org/development/guides/gha-basic/#pre-commit).

To install pre-commit to run checks for each commit you make:

```
$ pre-commit install
```

To manually run the pre-commit hooks without a commit:

```
$ pre-commit run --all-files
```

#### Running unit tests

Use `pytest` to run unit tests:

```
$ python -m pytest
```

Alternatively, use `scripts/run_ecdr_pytest.sh`.

#### Type-checking

Use `mypy` to run static typechecking

```
$ mypy
```

## Running tests / generating sample data

Can run unit and integration tests -- or manual subsets of -- with:

./scripts/run_ecdr_pytest.sh

Create an Initial Daily ECDR file with e.g.,:

./scripts/cli.sh idecdr --date 2021-04-05 --hemisphere north --resolution 12 --output-dir /tmp/
3 changes: 0 additions & 3 deletions gen_sample.sh

This file was deleted.

7 changes: 1 addition & 6 deletions scripts/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@

ARGS=$@

THIS_DIR="$( cd "$(dirname "$0")"; pwd -P )"
PM_ICECON_DIR=/home/vagrant/pm_icecon

# PYTHONPATH=$THIS_DIR/.. python -m pm_icecon.cli.entrypoint $ARGS
# PYTHONPATH=$THIS_DIR/..:${PM_ICECON_DIR} python -m seaice_ecdr.cli.entrypoint $ARGS
PYTHONPATH=$THIS_DIR/..:${PM_ICECON_DIR} python -m pm_icecon.cli.entrypoint $ARGS
python -m seaice_ecdr.cli.entrypoint $ARGS
File renamed without changes.
Loading

0 comments on commit 9dcb667

Please sign in to comment.