Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edits for JOSS reviews #195

Closed
wants to merge 136 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
bf6d552
chore: increase timeout for test shen moho
mdtanker Apr 24, 2024
c8525c9
build: explicitly specify tqdm as dependency
mdtanker Apr 24, 2024
65c0da1
docs: update contributing guide
mdtanker Apr 26, 2024
0331567
chore: cleanup Make commands
mdtanker Apr 26, 2024
ecdb81e
docs: simplify binder env
mdtanker Apr 26, 2024
71548a9
refactor: update np random number generator
mdtanker Apr 26, 2024
dde66fd
chore: update ruff version in pre-commit
mdtanker Apr 26, 2024
a7e9e8f
style: reformat with new ruff version
mdtanker Apr 26, 2024
85a5395
docs: remove python version and nodefaults from binder env
mdtanker Apr 26, 2024
7b0bf50
docs: fix issues with subplot_layout example
mdtanker Apr 26, 2024
7aa1586
docs: try nbgitpull link for launch binder buttons
mdtanker Apr 26, 2024
a68049c
docs: switch binder env to separate repo, remove launch buttons
mdtanker Apr 26, 2024
cf6eb2d
docs: conform fetch walkthrough to standard figure creation style
mdtanker Apr 26, 2024
824f40a
chore: add tests for regions
mdtanker Apr 26, 2024
0cdb39a
style: fix regions test styling
mdtanker Apr 26, 2024
cbe0258
style: add typing to function
mdtanker Apr 26, 2024
ad30f3c
docs: add available dataset gallery
mdtanker Apr 26, 2024
4159d41
docs: update dataset gallery template
mdtanker Apr 28, 2024
12769fc
docs: update bedmap2 dataset notebook
mdtanker Apr 28, 2024
9421f45
docs: add bedmachine dataset notebook
mdtanker Apr 28, 2024
e3e3540
fix: remove faulty layer name from fetch bedmachine
mdtanker Apr 28, 2024
e386d95
docs: mention dataset gallery in fetch walkthrough
mdtanker Apr 28, 2024
0d7cf2d
docs: update references
mdtanker Apr 28, 2024
f676793
docs: add more dataset notebooks
mdtanker Apr 29, 2024
9f7b646
docs: reorganize available dataset gallery
mdtanker Apr 29, 2024
801f35d
chore: don't run tests on docs or style commits
mdtanker Apr 29, 2024
671cb8d
Merge branch 'main' into mdtanker-patch-3
mdtanker Apr 29, 2024
7732b7a
feat: add Arctic/Greenland to utils/maps
mdtanker Apr 30, 2024
ef905b6
feat: add some Greenland regions
mdtanker Apr 30, 2024
15c6da7
feat: add fetch MODIS Greenland
mdtanker Apr 30, 2024
90a48fc
feat: add pen kwarg to show_region
mdtanker Apr 30, 2024
c8aa365
fix: load deepbedmap instead of returning string
mdtanker Apr 30, 2024
b6ecc54
docs: edit some docstrings
mdtanker Apr 30, 2024
e4158d8
docs: add more dataset notebooks
mdtanker May 8, 2024
a0b7434
fix: change greenland region slightly
mdtanker May 10, 2024
d047692
feat: add BAS greenland groundingline
mdtanker May 10, 2024
e532d6a
feat: add subset grid function
mdtanker May 10, 2024
676c5e5
chore: change default profile map cmap
mdtanker May 10, 2024
3a03996
feat: add hemisphere arg to most plotting functions
mdtanker May 10, 2024
8b3fbf9
chore: change arg `image` to `modis`
mdtanker May 10, 2024
5cebd40
chore: add greenland coast version to plotting functions
mdtanker May 10, 2024
ac818f1
fix: correctly center interactive map
mdtanker May 10, 2024
7b42c77
feat: add inset map option for greenland
mdtanker May 10, 2024
d0847da
chore: misc fixes
mdtanker May 10, 2024
01689b6
feat: allow passing .cpt file to colorbar histogram
mdtanker May 10, 2024
9deb908
fix: improve creation of colormap
mdtanker May 10, 2024
ee155de
feat: add function for combined min max of several grids
mdtanker May 10, 2024
6db8a59
docs: rerun all docs
mdtanker May 10, 2024
88b4293
docs: add modis mog to index
mdtanker May 10, 2024
83a8bdb
chore: fix test
mdtanker May 10, 2024
d999486
refactor: change default point color in plot_profile
mdtanker Jun 3, 2024
830c9bf
fix: warning about histogram if grid is constant value
mdtanker Jun 3, 2024
56fa9d7
feat: enable passing single grid to plot_3d
mdtanker Jun 3, 2024
89eab9a
fix: update figure shifting of plot_3d
mdtanker Jun 3, 2024
7271017
fix: update warning about grid region extract in plot_3d
mdtanker Jun 3, 2024
a3be2a0
feat: add cbar_perspective arg to plot_3d
mdtanker Jun 3, 2024
49cd2f2
refactor: remove default vlims for plot_3d
mdtanker Jun 3, 2024
e37b165
feat: add cbar_labels kwarg to plot_3d
mdtanker Jun 3, 2024
f7d0083
refactor: changed default shading to false in plot_3d
mdtanker Jun 3, 2024
7100cb8
refactor: set cbar position in plot_3d
mdtanker Jun 3, 2024
2dbfcd5
refactor: use new set_cmap function in plot_3d
mdtanker Jun 3, 2024
735db47
docs: rerun notebook
mdtanker Jun 3, 2024
0057006
docs: add GHF to dataset gallery
mdtanker Jun 3, 2024
0ea31f1
docs: use full citations in dataset gallery
mdtanker Jun 3, 2024
2200e0b
docs: add GIA to dataset gallery
mdtanker Jun 3, 2024
26c0775
docs: add gravity to dataset gallery
mdtanker Jun 3, 2024
429ef22
docs: add ice velocity to dataset gallery
mdtanker Jun 3, 2024
35ce670
docs: add magnetics to dataset gallery
mdtanker Jun 3, 2024
dc2ebb5
docs: add mass change to dataset gallery
mdtanker Jun 3, 2024
48f9e8b
docs: add groundline to dataset gallery
mdtanker Jun 3, 2024
56b5484
docs: add geomap geology to dataset gallery
mdtanker Jun 3, 2024
3d730a7
style: auto style fixes
mdtanker Jun 3, 2024
e6827db
docs: add basal melt rate to dataset gallery
mdtanker Jun 3, 2024
c36d034
docs: add measures ice boundaries to dataset gallery
mdtanker Jun 4, 2024
d8d4d99
style: auto style fix
mdtanker Jun 4, 2024
118ebc3
style: fixes for pylint
mdtanker Jun 4, 2024
76b9865
docs: add rosetta grav/mag to gallery datasets
mdtanker Jun 4, 2024
d5aeff8
chore: pre-commit autoupdate to monthly
mdtanker Jun 5, 2024
2f577aa
docs: clarify project scope and goals
mdtanker Jun 5, 2024
69450ac
docs: clarify all mentions of format of region tuples
mdtanker Jun 5, 2024
4dadc7c
fix: remove support for fetch ROSETTA grav and mag to align with goal…
mdtanker Jun 5, 2024
86be2e5
fix: remove fetch basement due to limited spatial extent of data
mdtanker Jun 5, 2024
65a845c
refactor: rename fetch `measures_boundaries` to `antarctic_boundaries`
mdtanker Jun 5, 2024
cf1ddd7
feat: add bedmachine data from Greenland
mdtanker Jun 10, 2024
cf84cdd
feat: add geoid for Greenland and change geoid region for Antarctica
mdtanker Jun 10, 2024
914c88f
fix: for bedmachine grids, restore correct registration type and only…
mdtanker Jun 10, 2024
a06cda6
chore: update tests for bedmachine with reference change
mdtanker Jun 10, 2024
9e3c60c
feat: add function to extract default hemisphere
mdtanker Jun 10, 2024
7ad3bb5
refactor: if available, use environmental variables for setting hemis…
mdtanker Jun 10, 2024
8dbf911
refactor: use environment variable for setting hemisphere in profile
mdtanker Jun 10, 2024
3a5dbae
refactor: log info instead of error in mask_from_shp
mdtanker Jun 10, 2024
4609165
docs: rerun notebooks
mdtanker Jun 10, 2024
8783c6d
feat: enable greenland support for profiles
mdtanker Jun 10, 2024
40c7194
style: auto fixes
mdtanker Jun 10, 2024
92dcb75
chore: update use of pylint
mdtanker Jun 11, 2024
b70c46a
build: set min pylint version
mdtanker Jun 11, 2024
598dc75
refactor: remove unnecessary verbose and kwargs for some fetches
mdtanker Jun 11, 2024
60fb982
style: ignore pylint warnings
mdtanker Jun 11, 2024
b0a9805
style: fix cmap issues in plot_profile
mdtanker Jun 11, 2024
aeb7db3
refactor: add hemisphere and remove kwargs from call to geoid
mdtanker Jun 11, 2024
6e7ea93
fix: specify hemisphere in bedmap2 reference test
mdtanker Jun 11, 2024
95a96ad
chore: exclude some md files from pre-commit
mdtanker Jun 11, 2024
88dea93
build: include environment.yml file as backup for issues with installing
mdtanker Jun 11, 2024
f1892b8
docs: consolidate and update install instructions
mdtanker Jun 11, 2024
5fe9295
docs: add release instructions to contributing guide
mdtanker Jun 11, 2024
5208468
docs: add instructions for EarthData login
mdtanker Jun 11, 2024
af34193
docs: add missing links
mdtanker Jun 11, 2024
3eaad06
feat: add mass change for Greenland
mdtanker Jun 11, 2024
a20caa7
chore: update fetch mass change test
mdtanker Jun 11, 2024
062e52e
feat: add etopo data for the arctic/greenland
mdtanker Jun 11, 2024
0b3962c
feat: add ice velocity for Greenland
mdtanker Jun 12, 2024
dc82f0a
refactor: combine fetch `modis_moa` and `modis_mog` to `modis`
mdtanker Jun 12, 2024
9876161
build: add deprecation package to dev deps
mdtanker Jun 12, 2024
9a85d17
chore: add deprecations to old fetch modis functions
mdtanker Jun 12, 2024
80df7bb
chore: add deprecation to old fetch measures boundaries function
mdtanker Jun 12, 2024
ad4dd21
style: style fixes
mdtanker Jun 12, 2024
ace1aa4
build: move deprecation from dev to normal dependencies
mdtanker Jun 12, 2024
c02fecd
docs: merge arctic and greenland dataset gallery
mdtanker Jun 12, 2024
af00c9e
refactor: move alter_region from utils to regions
mdtanker Jun 12, 2024
39201e1
feat: add region_ll_to_xy function
mdtanker Jun 12, 2024
c7c25e3
fix: properly set default region in basemap
mdtanker Jun 12, 2024
ab78495
feat: add points option to basemap
mdtanker Jun 12, 2024
f0f3f18
fix: remove alter region from get_regions
mdtanker Jun 12, 2024
f9523a4
docs: major overhaul of docs structure to follow the Divio system
mdtanker Jun 12, 2024
34bb39e
style: auto style fixes
mdtanker Jun 12, 2024
8f9abc9
fix: fix tests for deprecations
mdtanker Jun 12, 2024
882541c
fix: remove hash from mass_change
mdtanker Jun 13, 2024
3375aaf
fix: fix fetch ice vel issue
mdtanker Jun 13, 2024
dccb6a5
refactor: update deprecated pandas delim_whitespace
mdtanker Jun 13, 2024
7291513
fix: fix deprecated test alter region
mdtanker Jun 13, 2024
d28e211
fix: fix deprecated test measures boundaries
mdtanker Jun 13, 2024
0e5b57f
docs: rerun all dataset gallery notebooks
mdtanker Jun 13, 2024
22a5727
chore: add codecov token
mdtanker Jun 13, 2024
6097e94
Merge branch 'main' into mdtanker-patch-3
mdtanker Jun 13, 2024
53e7032
chore: mark some tests as earthdata
mdtanker Jun 13, 2024
a3df63a
docs: add logo to README
mdtanker Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ jobs:
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
run: pipx run nox -s pylint -- --output-format=github

# Run tests and upload to codecov
test:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
if: |
${{!startsWith(github.event.head_commit.message, 'docs:') }} ||
${{!startsWith(github.event.head_commit.message, 'style:') }}
needs: [pre-commit]
strategy:
# Otherwise, the workflow would stop if a single job fails. We want to
Expand Down Expand Up @@ -97,4 +98,6 @@ jobs:
--cov-report=term --durations=20

- name: Upload coverage report
uses: codecov/[email protected]
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_schedule: quarterly

exclude: |
(?x)^(
docs/index.md|
docs/install.md|
docs/citing.md|
docs/overview.md|
docs/reference.md|
docs/api/polartoolkit.rst|
docs/api/polartoolkit.fetch.rst|
docs/api/polartoolkit.maps.rst|
Expand All @@ -17,8 +22,8 @@ exclude: |
.github/ISSUE_TEMPLATE/feature_request.md|
.github/config.yml|
CONTRIBUTING.md|
binder/environment.yml|
templates/CHANGELOG.md.j2|
README.md|
)$

repos:
Expand All @@ -34,7 +39,7 @@ repos:
additional_dependencies: [black==23.7.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
rev: "v0.4.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -44,6 +49,7 @@ repos:
rev: "v4.5.0"
hooks:
- id: check-added-large-files
exclude: ^docs/datasets/
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
Expand Down
106 changes: 35 additions & 71 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<sub>Adapted from the great contribution guidelines of the [Fatiando a Terra](https://www.fatiando.org/) packages<sub>.

> This document contains some general guidlines to help with contributing to this code. Contributing to a package can be a daunting task, if you want help please reach out on the [GitHub discussions page](https://github.com/mdtanker/polartoolkit/discussions)!
> This document contains some general guidelines to help with contributing to this code. Contributing to a package can be a daunting task, if you want help please reach out on the [GitHub discussions page](https://github.com/mdtanker/polartoolkit/discussions)!

Any kind of help would be much appreciated. Here are a few ways to contribute:
* 🐛 Submitting bug reports and feature requests
Expand Down Expand Up @@ -40,7 +40,9 @@ contributions.
- [Code Review](#code-review)
* [Publish a new release](#publish-a-new-release)
* [Update the Dependencies](#update-the-dependencies)
* [Create a conda environment file](#create-a-conda-environment-file)
* [Set up Binder](#set-up-the-binder-configuration)
* [Release Checklist](#release-checklist)

## What Can I Do?

Expand Down Expand Up @@ -215,12 +217,14 @@ Leave a comment in the PR and we'll help you out.

The Docs are build with `Sphinx` and `Read the Docs`. Due to the above mentioned issues with the included C programs, `Read the Docs (RTD)` can't run the scripts which are part of the docs (i.e. the gallery examples). Because of this the notebooks don't execute on a build, as specified by `execute_notebooks: 'off'` in `_config.yml`. Here is how to run/update the docs on your local machine.

> **Note:** The docs are automatically built on PR's by `RTD`, but it's good practise to build them manually before a PR, to check them for errors.
> **Note:** The docs are automatically built on PR's by `RTD`, but it's good practice to build them manually before a PR, to check them for errors.

#### Run all .ipynb's to update them

make run_doc_files

If your edits haven't changed any part of the core package, then there is no need to re-run the notebooks. If you changed a notebook, just clear it's contents and re-run that one notebook.

#### Check the build manually (optional)

You can build the docs using, but this will require pandoc to be install on your machine:
Expand All @@ -239,14 +243,9 @@ nox -s docs -- --serve

Add, commit, and push all changes to GitHub in a Pull Request, and `RTD` should automatically build the docs.

In each PR, you will see section of the checks for RTD. Click on this to preview the docs for the PR.
In each PR, you will see section of the checks for `RTD`. Click on this to preview the docs for the PR.

RTD uses the conda environment specified in `env/RTD_env.yml` when it's building.
To create or update this file based on the necessary dependencies in [docs] of `pyproject.toml`, run the following command:

```
make RTD_env
```
`RTD` uses the conda environment specified in `env/RTD_env.yml` when it's building.

### Code Review

Expand Down Expand Up @@ -279,83 +278,48 @@ If you have any trouble, leave a comment in the PR or

This will almost always be done by the developers, but as a guide for them, here are instructions on how to release a new version of the package.

Follow all the above instructions for formating and building the docs
Follow all the above instructions for formatting. Push your changes to a new or existing Pull Request. Once the automated GitHub Actions run (and pass), merge the PR into the main branch.

### PyPI (pip)
Manually increment the version in polartoolkit/__init__.py:

version = "X.Y.Z"

Build the package locally into the /dist folder:

make build

Upload the dist files to Test PyPI:

make test_publish

This should automatically find the TestPyPI username and token from a `.pypirc` file in your home directory.

Make a new environment and activate it:

make test_pypi_env
mamba activate polartoolkit_test_pypi

and run the following, replacing the asterisks with the version number:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ polartoolkit==******

Run a few gallery examples to make sure this env works, then its ready to publish to the real PyPI:

make publish

Now push the changes to GitHub and make a release with the matching version number.
PyPI release are made automatically via GitHub actions whenever a pull request is merged.

### Conda-Forge
Once the new version is on PyPI, we can update the conda-forge feedstock.

Fork the [conda-forge polartoolkit feedstock](https://github.com/conda-forge/polartoolkit-feedstock) on github:

Clone the fork and checkout a new branch

git clone https://github.com/mdtanker/polartoolkit-feedstock

git checkout -b update

Update the `meta.yaml` with the new PyPI version with `grayskull`

grayskull pypi polartoolkit

Copy the new contents into the old `meta.yaml` file.

Push the changes to GitHub

git add .

git commit -m "updating polartoolkit"

git push origin update

Open a PR on GitHub with the new branch.
Once the new version is on PyPI, within a few hours a bot will automatically open a new PR in the [PolarToolkit conda-forge feedstock](https://github.com/conda-forge/polartoolkit-feedstock). Go through the checklist on the PR. Most of the time the only actions needs are updated any changes made to the dependencies since the last release. Merge the PR and the new version will be available on conda-forge shortly.

Once the new version is on conda, update the binder .yml file, as below.

## Update the dependencies

To add or update a dependencies, add it to `pyproject.toml` either under `dependencies` or `optional-dependencies`. This will be included in the next build uploaded to PyPI.

After release a new version on PyPI, we will create a new release on conda-forge, and the new dependencies should automatically be included there.
If you add a dependency necessary for using the package, make sure to add it to the Binder config file and update the `environment.yml` file in the repository. See below.

If you add a dependency necessary for using the package, make sure to add it to `env/env_test.ylm` and include it in the Binder config file. See below.
## Create a conda environment file

## Set up the binder configuration
As a backup options for users experiencing install issues, we include a `environment.yml` file in the repo, which users can download and install from. To update this, run the following commands:

```
make remove
make conda_install
```

To run this package online, Read the Docs will automatically create a Binder instance based on the configuration file `/binder/environment.yml`. This file reflects the latest release on Conda-Forge. Update it with the following commands.
## Set up the binder configuration

make conda_install
To run this package online, Read the Docs will automatically create a Binder instance based on the configuration file `environment.yml` in a separate repository [`Polartoolkit-Binder`](https://github.com/mdtanker/polartoolkit-binder). This file should reflect the latest release on Conda-Forge. To allow all optional features in Binder, we need to manually add optional dependencies to the `environment.yml` file. Also, to use the latest version of PolarToolkit within Binder, makes sure to update its version in the file after each release.

conda activate polartoolkit
Once updated, rebuild the Binder environment, look at which package versions Binder used for each specified dependency, and update the environment file with these versions.

make binder_env
Now, when submitting a PR, RTD will automatically build the docs and update the Binder environment.

Now, when submitting a PR, RTD will automatically build the docs and update the Binder environment.
## Release Checklist
* re-run any relevant notebooks
* check docs are building correctly using the GitHub actions link within the PR
* merge the PR
* wait for `PyPI` to publish the new version [here](https://pypi.python.org/pypi/polartoolkit)
* wait for a PR to be opened in the [feedstock](https://github.com/conda-forge/polartoolkit-feedstock)
* update any changed dependencies in the feedstock PR and merge
* wait for `conda` to publish the new version [here](https://anaconda.org/conda-forge/polartoolkit)
* update backup `env/environment.yml`
* update polartoolkit version in `environment.yml` in [PolarToolkit-Binder repo](https://github.com/mdtanker/polartoolkit-binder/blob/main/environment.yml)
* test `PyPI` version with `make install_test` and `make test`
* test `conda` version with `make conda_install` and `make test`
76 changes: 41 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,47 @@
PROJECT=polartoolkit
STYLE_CHECK_FILES=.

create:
mamba create --name $(PROJECT) --yes --force pygmt geopandas python=3.11
####
####
# install commands
####
####

create_test_env:
mamba create --name test --yes python=3.11
create:
mamba create --name $(PROJECT) --yes --force --channel conda-forge pygmt geopandas python=3.11

install:
pip install -e .[all]

install_test:
pip install polartoolkit[all]
pip install $(PROJECT)[all]

remove:
mamba remove --name $(PROJECT) --all

conda_install:
mamba create --name $(PROJECT) --yes --force --channel conda-forge $(PROJECT)

conda_export:
mamba env export --name $(PROJECT) --channel conda-forge --file env/environment.yml
####
####
# test commands
####
####

test:
pytest -m "not earthdata and not issue and not fetch"

test_fetch:
pytest -s -m fetch #-rp

####
####
# style commands
####
####

format:
ruff format $(STYLE_CHECK_FILES)

Expand All @@ -33,12 +53,19 @@ lint:
pre-commit run --all-files

pylint:
pylint polartoolkit
pylint $(PROJECT)

style: format check lint pylint

mypy:
mypy src/polartoolkit
mypy src/$(PROJECT)


####
####
# chore commands
####
####

release_check:
semantic-release --noop version
Expand All @@ -52,6 +79,13 @@ license-add:
license-check:
python tools/license_notice.py --check


####
####
# doc commands
####
####

run_gallery:
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/gallery/*.ipynb

Expand All @@ -63,31 +97,3 @@ run_doc_files:
jupyter nbconvert --ExecutePreprocessor.allow_errors=True --execute --inplace docs/*/*.ipynb

run_notebooks: run_gallery run_tutorials run_doc_files

# install with conda
conda_install:
mamba create --name polartoolkit --yes --force polartoolkit

# create binder yml
binder_env:
mamba env export --name polartoolkit --no-builds > binder/environment.yml

# create ReadTheDocs yml
RTD_env:
mamba remove --name RTD_env --all --yes
mamba create --name RTD_env --yes --force python==3.11 pygmt>=0.10.0
mamba env export --name RTD_env --no-builds --from-history > env/RTD_env.yml
# delete last line
sed -i '$$d' env/RTD_env.yml
# add pip and install local package
sed -i '$$a\ - pip\n - pip:\n - ../.[docs]' env/RTD_env.yml

# create testing yml
testing_env:
mamba remove --name testing_env --all --yes
mamba create --name testing_env --yes --force pygmt
mamba env export --name testing_env --no-builds --from-history > env/testing_env.yml
# delete last line
sed -i '$$d' env/testing_env.yml
# add pip and install local package
sed -i '$$a\ - pip\n - pip:\n - ../.[test]' env/testing_env.yml
Loading
Loading