diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/.github/config.yml b/.github/config.yml index 153a3a25..4bd2e829 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -5,7 +5,7 @@ # Comment to be posted to on first time issues newIssueWelcomeComment: > - 👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our [contributing guidelines](https://polartoolkit.readthedocs.io/en/latest/contributing.html). + 👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our [contributing guidelines](https://github.com/mdtanker/polartoolkit/blob/main/docs/contribute.md). # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome @@ -13,7 +13,7 @@ newIssueWelcomeComment: > newPRWelcomeComment: > 💖 Thanks for opening this pull request! 💖 - Please make sure you read our [contributing guidelines](https://polartoolkit.readthedocs.io/en/latest/contributing.html). + Please make sure you read our [contributing guidelines](https://github.com/mdtanker/polartoolkit/blob/main/docs/contribute.md). A few things to keep in mind: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31da03c6..ade72322 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: # run all of them to catch failures in different combinations. fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11"] runs-on: [ubuntu-latest, macos-latest, windows-latest] env: @@ -73,7 +73,7 @@ jobs: uses: conda-incubator/setup-miniconda@v3 with: activate-environment: polartoolkit - environment-file: env/testing_env.yml + environment-file: env/test_env.yml python-version: ${{ matrix.python-version }} channels: conda-forge,nodefaults channel-priority: strict @@ -83,18 +83,18 @@ jobs: use-mamba: true auto-activate-base: false + # Show installed pkg information for postmortem diagnostic + - name: List installed packages + run: mamba list + # Install the package in editable mode - name: Install local package run: pip install -e . - # Show installed pkg information for postmortem diagnostic - - name: List installed packages - run: mamba list - - name: Run the tests run: >- pytest -m "not earthdata and not issue" -ra --cov --cov-report=xml --cov-report=term --durations=20 - name: Upload coverage report - uses: codecov/codecov-action@v4.1.0 + uses: codecov/codecov-action@v4.0.1 diff --git a/.github/workflows/semantic_release.yml b/.github/workflows/semantic_release.yml index 38cce14d..a3b82972 100644 --- a/.github/workflows/semantic_release.yml +++ b/.github/workflows/semantic_release.yml @@ -46,8 +46,6 @@ jobs: with: fetch-depth: 0 token: ${{secrets.PAT}} - - name: git pull - run: git pull origin main --rebase # use semantic-release - id: semantic-release diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b0059c4..3db6f1b5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,14 +16,10 @@ exclude: | .github/ISSUE_TEMPLATE/bug_report.md| .github/ISSUE_TEMPLATE/feature_request.md| .github/config.yml| - CONTRIBUTING.md| + .github/CONTRIBUTING.md| binder/environment.yml| -<<<<<<< HEAD paper/paper.bib| paper/paper.md| -======= - templates/CHANGELOG.md.j2| ->>>>>>> 3fffd15 (chore: add ignores to pre-commit) )$ repos: diff --git a/CHANGELOG.md b/CHANGELOG.md index 37629b84..c3bac738 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,34 +2,10 @@ Automatically updated by [python-semantic-release](https://python-semantic-release.readthedocs.io/en/latest/) with commit parsing of [angular commits](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits). - ## Unreleased -### 📦️ Build -### 🧰 Chores / Maintenance -* fix semantic release action ([`6b12799`](https://github.com/mdtanker/polartoolkit/commit/6b12799d984917e9e4693bf8003c6869fc7f350d)) - -## v0.3.1 (2024-02-22) -### 📦️ Build -* extend support to python 3.12 ([`f68def9`](https://github.com/mdtanker/polartoolkit/commit/f68def9b1156f020d4e222bf27279293eddda51f)) -### 🧰 Chores / Maintenance -* remove shen-2018 hash ([`fbefe40`](https://github.com/mdtanker/polartoolkit/commit/fbefe4031c2b241fdde5b6375bc16b504ec6b9ac)) -* fix test ghf ([`c7c66f6`](https://github.com/mdtanker/polartoolkit/commit/c7c66f60fce00b50524abc6eca01238f40b932e1)) -* update changelog template ([`e4bd1d9`](https://github.com/mdtanker/polartoolkit/commit/e4bd1d923fb635ac2c9724a9c8babbe3cd9a4660)) -* reduce sig figs for test_ghf ([`393aadc`](https://github.com/mdtanker/polartoolkit/commit/393aadc4394bc0da73d4eb38e1318bc04f374636)) -* list packages after installing local for test GHA ([`51250b4`](https://github.com/mdtanker/polartoolkit/commit/51250b4dfa2a8c59380fe16d5f00e68edf453e2d)) -* update testing_env and add make command ([`4ee6945`](https://github.com/mdtanker/polartoolkit/commit/4ee6945f06c39447a6447f3563898c867696fb5c)) -* add hashes to all fetch calls ([`91eb9a8`](https://github.com/mdtanker/polartoolkit/commit/91eb9a83fcdd247b7a55491b0654ae5734c46fed)) -* move contributing file ([`05dff10`](https://github.com/mdtanker/polartoolkit/commit/05dff10fb72fa82a4e24ecf6e47a73d40cdc9c63)) -* add test_fetch make command ([`2a0adb3`](https://github.com/mdtanker/polartoolkit/commit/2a0adb30cdc669b602d6b0f5cdc402b3f5306872)) -* add ignores to pre-commit ([`3fffd15`](https://github.com/mdtanker/polartoolkit/commit/3fffd15defb6de572e2f8caa1e0380a760ac74dd)) -* fix changelog template spacing ([`cabc14a`](https://github.com/mdtanker/polartoolkit/commit/cabc14a644d10bf7eafe26c223a5542e17f10bf4)) ### 📖 Documentation -* update install instructions ([`70faf04`](https://github.com/mdtanker/polartoolkit/commit/70faf0485d1157dda42e3f40ca462d89d87fafad)) * fix links to contrib guide ([`5c6af8d`](https://github.com/mdtanker/polartoolkit/commit/5c6af8de8ab984fa645f868ba23eadd492f0d4b7)) -### 🐛 Bug Fixes -* increase timeout for shen-2018 moho fetch ([`8d9e183`](https://github.com/mdtanker/polartoolkit/commit/8d9e183de4aca1cc985a4824414b3107c50905e6)) -* delete tmp.nc file in fetch call ([`ee16bdc`](https://github.com/mdtanker/polartoolkit/commit/ee16bdc10f000d1d05cabc889890548fd2f72dbe)) ## v0.3.0 (2024-02-18) ### 📦️ Build @@ -74,7 +50,6 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b * formatting ([`0b294a1`](https://github.com/mdtanker/polartoolkit/commit/0b294a18d71d909bcbbd398dc0634b548faf7165)) * fix style errors ([`639ba42`](https://github.com/mdtanker/polartoolkit/commit/639ba42c996db46125b5889e5ae35e09217296d7)) * fix indent ([`efee6d7`](https://github.com/mdtanker/polartoolkit/commit/efee6d702e7db92b5f32d4136be2b0b18eeaf54a)) - ## v0.2.1 (2024-01-29) ### 📦️ Build * add antarctic_plots package for import warning ([`bb4c134`](https://github.com/mdtanker/polartoolkit/commit/bb4c134b6e78377d426781ef1f601a5ba171000b)) @@ -92,9 +67,8 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b * spelling and formatting ([`a7347ba`](https://github.com/mdtanker/polartoolkit/commit/a7347ba6ca94185414ac3d0a0eec1bb1ef095bfb)) * spelling mistakes ([`4c29294`](https://github.com/mdtanker/polartoolkit/commit/4c2929402b66903b2ddc0688333b932c44bba978)) * ignore binder env file in pre-commit ([`9aa1c30`](https://github.com/mdtanker/polartoolkit/commit/9aa1c309352965131c40b3d88c4e16afbcdf48a6)) - ## v0.2.0 (2024-01-26) -### 💥 Breaking Changes +### Other * force a major version bump. BREAKING CHANGE: ([`cc2ecda`](https://github.com/mdtanker/polartoolkit/commit/cc2ecdaae48b4300ae6d41485076273fa612ce64)) @@ -113,7 +87,6 @@ BREAKING CHANGE: ([`cc2ecda`](https://github.com/mdtanker/polartoolkit/commit/cc * fix changelog template ([`31083e3`](https://github.com/mdtanker/polartoolkit/commit/31083e3d729cd4fb17f2149665610c5ba7fcd2c0)) ### ✏️ Formatting * formatting ([`d15fe92`](https://github.com/mdtanker/polartoolkit/commit/d15fe924d6097c64b410e4a0802b63774e17074e)) - ## v0.1.0 (2023-12-10) ### 📦️ Build * fix path to docs ([`4bbbd96`](https://github.com/mdtanker/polartoolkit/commit/4bbbd9639a75a50305e28c8102afdda58b774534)) @@ -239,14 +212,21 @@ increments filename variabls since they change type, and standardizes the format * formatting ([`f9f82f8`](https://github.com/mdtanker/polartoolkit/commit/f9f82f8201e08212e61c431a9259075884f1b4c5)) ### Other * ([`90302ba`](https://github.com/mdtanker/polartoolkit/commit/90302ba4e059c6688dad9468c42cb38c62ad6540)) + * ([`12a5299`](https://github.com/mdtanker/polartoolkit/commit/12a5299d590c3ce16e797fd3efd18ea8e7b2234c)) + * ([`c962e56`](https://github.com/mdtanker/polartoolkit/commit/c962e56ca0eca300b9f45bd4104861cd9fdf67dd)) + * ([`95ad63c`](https://github.com/mdtanker/polartoolkit/commit/95ad63c9af3c9b305fdbc97c984ac6bee952c3bf)) + * ([`30ea5aa`](https://github.com/mdtanker/polartoolkit/commit/30ea5aaea6cf599299e0cc7253eaf136b1e54a59)) + * ([`d8c821e`](https://github.com/mdtanker/polartoolkit/commit/d8c821ee79f146bc74171ae358a331815ba1ac7d)) + * ([`f1249f0`](https://github.com/mdtanker/polartoolkit/commit/f1249f0d7cb848f489bd25f8364d1693e704f886)) + > **Note:** >🚨 Everything above this point was generated automatically by Python Semantic Release. diff --git a/Makefile b/Makefile index 6544e330..9f7b4c91 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,6 @@ remove: test: pytest -m "not earthdata and not issue and not fetch" -test_fetch: - pytest -s -m fetch #-rp - format: ruff format $(STYLE_CHECK_FILES) @@ -81,13 +78,3 @@ RTD_env: 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 diff --git a/docs/contributing.md b/docs/contributing.md index 66c1f98d..01fbe425 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,3 +1,3 @@ -```{include} ../CONTRIBUTING.md +```{include} ../.github/CONTRIBUTING.md ``` diff --git a/docs/install.md b/docs/install.md index 096dc659..92ef688f 100644 --- a/docs/install.md +++ b/docs/install.md @@ -10,60 +10,39 @@ gives full access the the package in an online environment. This Binder environment can also be accessed by clicking the Binder icon in any of the `gallery` or `tutorial` examples. -## Install Python - -Before installing _PolarToolkit_, ensure you have Python downloaded. If you -don't, I recommend setting up Python with Miniforge. See the install -instructions [here](https://github.com/conda-forge/miniforge). - -## Install _PolarToolkit_ Locally - -There are 3 main ways to install `polartoolkit`. We show them here in order of -simplest to hardest. +## Install package ### Conda / Mamba The easiest way to install this package and it's dependencies is with conda or mamba into a new virtual environment: -``` -mamba create --name polartoolkit --yes --force polartoolkit -``` + mamba create --name polartoolkit --yes --force polartoolkit Activate the environment: -``` -conda activate polartoolkit -``` + conda activate polartoolkit ### Pip -Instead, you can use pip to install `polartoolkit`, but first you need to -install a few dependencies with conda. This is because `PyGMT` `GeoPandas`, and +Instead, you can use pip to install polartoolkit, but first you need to install +a few dependencies with conda. This is because `PyGMT` `GeoPandas`, and `Cartopy` all rely on C packages, which can only be install with conda/mamba and -not with pip. - -```{note} -`conda` and `mamba` are interchangeable -``` +not with pip. ere I use mamba, but conda will work as well, just replace any +`mamba` with `conda`: Create a new virtual environment: -``` -mamba create --name polartoolkit --yes --force pygmt geopandas cartopy -``` + mamba create --name polartoolkit --yes --force pygmt geopandas cartopy -activate the environment and use `pip` to install `polartoolkit`: +Pip install polartoolkit -``` -mamba activate polartoolkit -pip install polartoolkit -``` + mamba activate polartoolkit + pip install polartoolkit -```{note} -to install the optional dependencies, use this instead: -`pip install polartoolkit[all]` -``` +If you don't have Python set up on your computer, I recommend setting up python +with Miniconda. See the install instructions +[here](https://conda.io/projects/conda/en/latest/user-guide/install/index.html). ### Development version diff --git a/env/test_env.yml b/env/test_env.yml new file mode 100644 index 00000000..36cb2560 --- /dev/null +++ b/env/test_env.yml @@ -0,0 +1,52 @@ +# Requirements for running the GitHub Action: test +# only need run-time dependencies +name: polartoolkit +channels: + - conda-forge + - defaults +dependencies: + - python>=3.9 + - pip + # Run-time + - pandas + - openpyxl + - pooch + - tqdm + - verde>=1.8.0 + - xarray + - netcdf4 + - h5netcdf + - harmonica>=0.6.0 + - pyproj + - matplotlib + - pyogrio + - rioxarray + - scipy + - numpy + - pygmt + - geopandas + - zarr + - python-dotenv + - nptyping + # interavtive + - geoviews + - cartopy + - ipyleaflet + - ipython + # viz + - seaborn + # test + - pytest>=6 + - pytest-cov>=3 + - deepdiff + # docs + - sphinx>=4.0 + - myst-parser + - sphinx-copybutton + - sphinx-autodoc-typehints + - sphinx-book-theme>=0.3 + - sphinx-design + - nbsphinx + - nbconvert + - pip: + - ../. diff --git a/env/testing_env.yml b/env/testing_env.yml deleted file mode 100644 index 9354b230..00000000 --- a/env/testing_env.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: testing_env -channels: - - conda-forge -dependencies: - - pygmt - - pip - - pip: - - ../.[test] diff --git a/paper/paper.md b/paper/paper.md index acd18e74..a68d22d2 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -65,12 +65,12 @@ Additionally, `PolarToolkit` provides an easy means for exploring datasets with # Statement of need -A common workflow for a geospatial scientist might be: navigate to an online repository and download a dataset, place this downloaded file in a local folder on their computer, perform some preprocessing steps, such a re-projecting, or interpolating the data, possibly using tools like GMT [@wesselgeneric2019], perform their scientific analysis on the data, and then create a map with this data using a graphical user interface (GUI) application such as QGIS [@qgisdevelopmentteamqgis2024]. +A common workflow for a geospatial scientist might be; navigate to a online repository and download a dataset, place this downloaded file in a local folder on their computer, perform some preprocessing steps, such a re-projecting, or interpolating the data, possibly using tools like GMT [@wesselgeneric2019], perform their scientific analysis on the data, and then create a map with this data using a graphical user interface (GUI) application such as QGIS [@qgisdevelopmentteamqgis2024]. These workflows typically require many separate tools (i.e. internet browser, file browser, spatial analysis software, and mapping software), and are often manually repeated many times throughout a manuscript revision process, and throughout the career of the scientist. `PolarToolkit` aims to consolidate this workflow to be entirely contained within Python, making it both easier and faster to perform all these steps. -Scripting workflows like this has several advantages: 1) it decreases the chance of human errors, for example using an old-version of the downloaded data or accidentally altering a pre-processing steps, such as referencing a raster of elevation data to the geoid instead of the ellipsoid, and 2) it allows entire workflows to be shared easily between collaborators with a single python file or Jupyter Notebook. -Although a popular and well-designed similar package exists [Antarctic Mapping Tools, @greeneantarctic2017], PolarToolkit is unique in its open-access without the need for a paid MatLab license. +Scripting workflows like this has several advantages; 1) it decreases the chance of human errors, for example using an old-version of the downloaded data or accidentally altering a pre-processing steps, such as referencing a raster of elevation data to the geoid instead of the ellipsoid, and 2) it allows entire workflows to be shared easily between collaborators with a single python file or Jupyter Notebook. +Although a popular and well-designed similar package exists [Antarctic Mapping Tools, @greeneantarctic2017], PolarToolkit is unique in it's open-access without the need for a paid MatLab license. Written in easy-to-learn Python, and utilizing common geospatial data structures, `PolarToolkit` is designed to be familiar to use for experienced Python users, while also being approachable for beginner coders. It is built upon several open-source packages, such a [Pooch](https://www.fatiando.org/pooch/latest/) for data downloading [@uiedapooch2020], [PyGMT](https://www.pygmt.org/latest/) for creating figures [@uiedapygmt2021], and [xarray](https://docs.xarray.dev/en/stable/) and [verde](https://www.fatiando.org/verde/latest/) for geospatial data processing [@hoyerxarray2017; @uiedaverde2018]. @@ -285,4 +285,4 @@ fig.show() |fig.show() | | |``` | | +--------------------------------------+-------------------------+ ---> +--> \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7af9fa32..31bd3028 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,11 +24,10 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", "Typing :: Typed", ] readme = "README.md" -version = "0.3.1" +version = "0.3.0" license = {file = "LICENSE"} keywords = ["cryosphere", "antarctica", "arctic", "greenland", "maps", "plotting", "pygmt", "cross-section"] diff --git a/src/polartoolkit/__init__.py b/src/polartoolkit/__init__.py index b2d565ad..820a03d4 100644 --- a/src/polartoolkit/__init__.py +++ b/src/polartoolkit/__init__.py @@ -9,4 +9,4 @@ from __future__ import annotations -__version__ = "0.3.1" +__version__ = "0.3.0" diff --git a/src/polartoolkit/fetch.py b/src/polartoolkit/fetch.py index 51dcd6a2..37c7a8fa 100644 --- a/src/polartoolkit/fetch.py +++ b/src/polartoolkit/fetch.py @@ -276,17 +276,12 @@ def sample_shp(name: str) -> str: str file path as a string """ - if name == "Disco_deep_transect": - known_hash = "70e86b3bf9775dd824014afb91da470263edf23159a9fe34107897d1bae9623e" - elif name == "Roosevelt_Island": - known_hash = "83434284808d067b8b18b649e41287a63f01eb2ce581b2c34ee44ae3a1a5ca2a" path = pooch.retrieve( url=f"https://github.com/mdtanker/polartoolkit/raw/main/data/{name}.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/shapefiles", processor=pooch.Unzip(), - known_hash=known_hash, + known_hash=None, ) - val: str = next(p for p in path if p.endswith(".shp")) return val @@ -342,7 +337,7 @@ def mass_change( url=url, fname=zip_fname, path=f"{pooch.os_cache('pooch')}/polartoolkit/ice_mass", - known_hash="8d09ffcce4e84fba8cabbc85ee79fec4de36419f8b242ca1f95adacaa2f229e3", + known_hash=None, progressbar=True, processor=pooch.Unzip( extract_dir="Smith_2020", @@ -435,7 +430,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname=fname, path=f"{pooch.os_cache('pooch')}/polartoolkit/ice_mass/Admusilli_2020", - known_hash="c14f7059876e6808e3869853a91a3a17a776c95862627c4a3d674c12e4477d2a", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -575,7 +570,7 @@ def preprocessing_5k(fname: str, action: str, _pooch2: typing.Any) -> str: fname="measures_ice_vel_phase_map.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/ice_velocity", downloader=EarthDataDownloader(), - known_hash="fa0957618b8bd98099f4a419d7dc0e3a2c562d89e9791b4d0ed55e6017f52416", + known_hash=None, progressbar=True, processor=preprocessor, ) @@ -625,7 +620,7 @@ def modis_moa( path=f"{pooch.os_cache('pooch')}/polartoolkit/imagery", downloader=EarthDataDownloader(), processor=pooch.Decompress(method="gzip", name="moa125_2009_hp1_v02.0.tif"), - known_hash="101fa22295f94f6eab487d208c051cf81c9af925355b124a04e3d96463af5b72", + known_hash=None, progressbar=True, ) elif version == "750m": @@ -635,7 +630,7 @@ def modis_moa( path=f"{pooch.os_cache('pooch')}/polartoolkit/imagery", downloader=EarthDataDownloader(), processor=pooch.Decompress(method="gzip", name="moa750_2009_hp1_v02.0.tif"), - known_hash="90d1718ea0971795ec102482c47f308ba08ba2b88383facb9fe210877e80282c", + known_hash=None, progressbar=True, ) else: @@ -669,7 +664,7 @@ def imagery() -> str: fname="lima.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/imagery", processor=pooch.Unzip(), - known_hash="7e7daa7af128f1ad18ac597d95d716ba26f745e75f8abb81c10049419a070c37", + known_hash=None, progressbar=True, ) return typing.cast(str, next(p for p in path if p.endswith(".tif"))) @@ -709,7 +704,7 @@ def geomap( url=url, fname=fname, path=f"{pooch.os_cache('pooch')}/polartoolkit/shapefiles/geomap", - known_hash="0dd1ec3f276d7aec1bddface7280ae3c10a40d8dea1efd9271803284a1120f84", + known_hash=None, processor=pooch.Unzip(extract_dir="geomap"), progressbar=True, ) @@ -813,7 +808,7 @@ def groundingline( url="https://doi.pangaea.de/10013/epic.42133.d001", fname="groundingline_depoorter_2013.d001", path=f"{pooch.os_cache('pooch')}/polartoolkit/shapefiles/depoorter-2013", - known_hash="e4c5918240e334680aed1329f109527efd8f43b6a277bb8e77b66f84f8c16619", + known_hash=None, processor=pooch.Unzip(), progressbar=True, ) @@ -1009,7 +1004,7 @@ def basement( url="https://download.pangaea.de/dataset/941238/files/Ross_Embayment_basement_filt.nc", fname="basement.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/basement", - known_hash="2b4fd53d1bb766d265ba7d504bf446fe4e4c77a5f4ab568892908edf385d9c67", + known_hash=None, progressbar=True, ) @@ -1132,7 +1127,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://www.itpz-ran.ru/wp-content/uploads/2021/04/0.1_lim_b.dat_.zip", fname="ANTASed.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/sediment_thickness", - known_hash="7ca77e5be871b1d2ff8a42166b2f9c4e779604fe2dfed5e70c029a2d03bc866b", + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -1166,7 +1161,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://download.pangaea.de/dataset/941238/files/Ross_Embayment_sediment.nc", fname="tankersley_2022_sediment_thickness.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/sediment_thickness", - known_hash="0a39e57875780e6f499b570f738a464588059cb195cb709785f2436934c1c4e7", + known_hash=None, progressbar=True, ) @@ -1199,7 +1194,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://store.pangaea.de/Publications/WobbeF_et_al_2016/sedthick_total_v2_5km_epsg3031.nc", fname="lindeque_2016_total_sediment_thickness.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/sediment_thickness", - known_hash="c156a9e9960d965e0599e449a393709f6720af1d1a25c22613c6be7726a213d7", + known_hash=None, progressbar=True, ) @@ -1284,7 +1279,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://ngdc.noaa.gov/mgg/sedthick/data/version3/GlobSed.zip", fname="GlobSed.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/sediment_thickness", - known_hash="e063ee6603d65c9cee6420cb52a4c6afb520143711b12d618f1a2f591d248bd9", + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -1334,7 +1329,7 @@ def ibcso_coverage( url="https://download.pangaea.de/dataset/937574/files/IBCSO_v2_coverage.gpkg", fname="IBCSO_v2_coverage.gpkg", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="b89e54f26c03b74f0b0f8d826f0f130573eac2c8240de2eb178c8840f0aa99a0", + known_hash=None, progressbar=True, ) @@ -1532,7 +1527,7 @@ def preprocessing_5k(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://download.pangaea.de/dataset/937574/files/IBCSO_v2_ice-surface.nc", fname="IBCSO_ice_surface.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="7748a79fffa41024c175cff7142066940b3e88f710eaf4080193c46b2b59e1f0", + known_hash=None, progressbar=True, processor=preprocessor, ) @@ -1541,7 +1536,7 @@ def preprocessing_5k(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://download.pangaea.de/dataset/937574/files/IBCSO_v2_bed.nc", fname="IBCSO_bed.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="74d55acb219deb87dc5be019d6dafeceb7b1ebcf9095866f257671d12670a5e2", + known_hash=None, progressbar=True, processor=preprocessor, ) @@ -1645,7 +1640,7 @@ def bedmachine( fname="bedmachine_v3.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", downloader=EarthDataDownloader(), - known_hash="d34390f585e61c4dba0cecd9e275afcc9586b377ba5ccc812e9a004566a9e159", + known_hash=None, progressbar=True, ) @@ -1757,7 +1752,7 @@ def bedmap_points( url=url, fname="BEDMAP1_1966-2000_AIR_BM1.csv", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="77d10a0c41ff3401a2a3da1467ba292861a919c6a43a933c91a51d2e1ebe5f6e", + known_hash=None, progressbar=True, ) @@ -1869,7 +1864,7 @@ def bedmap2( "+-+gridding+products/bedmap2_tiff?entryid=synth%3Afa5d606c-dc95-47ee-9016" "-7a82e446f2f2%3AL2JlZG1hcDJfdGlmZg%3D%3D&output=zip.zipgroup" ) - known_hash = None + # Declare initial grid values, of .nc files not .tiff files # use utils.get_grid_info(xr.load_dataset(file).band_data # several of the layers have different values @@ -1957,7 +1952,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="bedmap2_tiff.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash=known_hash, + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -1970,7 +1965,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="bedmap2_tiff.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash=known_hash, + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -2008,7 +2003,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="bedmap2_tiff.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash=known_hash, + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -2035,7 +2030,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="bedmap2_tiff.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash=known_hash, + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -2052,7 +2047,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="bedmap2_tiff.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash=known_hash, + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -2139,7 +2134,6 @@ def rema( ) fname = "rema_mosaic_500m_v2.0_filled_cop30.tar.gz" members = ["rema_mosaic_500m_v2.0_filled_cop30_dem.tif"] - known_hash = "dd59df24d1ee570654d79afc099c260aeb4128f67232f8c7258a8a7803ef3e0c" elif version == "1km": # found with utils.get_grid_info(grid) initial_region = (-2700500.0, 2750500.0, -2500500.0, 3342500.0) @@ -2152,7 +2146,6 @@ def rema( ) fname = "rema_mosaic_1km_v2.0_filled_cop30.tar.gz" members = ["rema_mosaic_1km_v2.0_filled_cop30_dem.tif"] - known_hash = "143ab56b79a0fdcae6769a895202af117fb0dbfe1fa2a0a17db9df2091338d21" else: msg = "invalid version" raise ValueError(msg) @@ -2199,7 +2192,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname=fname, path=f"{pooch.os_cache('pooch')}/polartoolkit/topography/REMA", - known_hash=known_hash, + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -2265,7 +2258,7 @@ def deepbedmap( url="https://zenodo.org/record/4054246/files/deepbedmap_dem.tif?download=1", fname="deepbedmap.tif", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="d8bca00bf6e999d6f77490943454d730f519ebd04b8a9511b9913313c7d954b1", + known_hash=None, progressbar=True, ) @@ -2361,7 +2354,7 @@ def gravity( url="https://hs.pangaea.de/Maps/antgg2015/antgg2015.nc", fname="antgg.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="ad94d16f7e4895c5a09bbf9ca9d64750f1edd9b01f2bff21ca49e10b6fe47d72", + known_hash=None, progressbar=True, ) @@ -2456,7 +2449,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://ftp.space.dtu.dk/pub/RF/4D-ANTARCTICA/ant4d_gravity.zip", fname="antgg_update.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="1013a8fa610c16198bc3c901039fd535cf939e4f21f99e6434849bb505094974", + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -2517,7 +2510,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="doi:10.5281/zenodo.5882207/earth-gravity-10arcmin.nc", fname="eigen.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="d55134501da0d984f318c0f92e1a15a8472176ec7babde5edfdb58855190273e", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -2616,7 +2609,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="doi:10.5281/zenodo.5882203/earth-topography-10arcmin.nc", fname="etopo.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/topography", - known_hash="e45628a3f559ec600a4003587a2b575402d22986651ee48806930aa909af4cf6", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -2719,7 +2712,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="doi:10.5281/zenodo.5882204/earth-geoid-10arcmin.nc", fname="eigen_geoid.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/geoid", - known_hash="e98dd544c8b4b8e5f11d1a316684dfbc2612e2860af07b946df46ed9f782a0f6", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -2778,7 +2771,7 @@ def rosetta_gravity(version: str = "gravity") -> pd.DataFrame: url="http://wonder.ldeo.columbia.edu/data/ROSETTA-Ice/GridInformation/Shapefile/ROSETTA-Ice_Grid_Flown_Shapefile.zip", fname="ROSETTA-Ice_Grid_Flown_Shapefile.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="17e0026fe386503d74c679a6091235e2394fb269030f5555372e55bdf61f6946", + known_hash=None, progressbar=True, processor=pooch.Unzip(), ) @@ -2792,7 +2785,7 @@ def rosetta_gravity(version: str = "gravity") -> pd.DataFrame: url="http://wonder.ldeo.columbia.edu/data/ROSETTA-Ice/Gravity/rs_2019_grav.csv", fname="ROSETTA_2019_grav.csv", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="d4fdfcc293ac13e6222938bfa9e1e9ccc781ea7556a13d356e9f1b4aba809928", + known_hash=None, progressbar=True, ) @@ -2807,7 +2800,7 @@ def rosetta_gravity(version: str = "gravity") -> pd.DataFrame: url="http://wonder.ldeo.columbia.edu/data/ROSETTA-Ice/DerivedProducts/Density/rs_2019_density.csv", fname="rs_2019_density.csv", path=f"{pooch.os_cache('pooch')}/polartoolkit/gravity", - known_hash="8c3d6f69087095ab1a184d0517a136ebd59e4761110601b30da1ef3685883617", + known_hash=None, progressbar=True, ) @@ -3065,7 +3058,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="http://admap.kopri.re.kr/admapdata/ant_new.zip", fname="admap1.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/magnetics", - known_hash="3fe567c4dfe75be9d5a7772623c72cd27fa386b09a82f03bdb0153a7d64e8524", + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -3140,7 +3133,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://hs.pangaea.de/mag/airborne/Antarctica/ADMAP2A.zip", fname="admap2_gdb.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/magnetics", - known_hash="a587555677350257dadbbf615838deac67e7d183a16525996ea0954eb23d83e8", + known_hash=None, processor=pooch.Unzip(), progressbar=True, ) @@ -3253,9 +3246,6 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: reprojected.to_netcdf("tmp.nc") processed = xr.load_dataset("tmp.nc").z - # remove tmp file - pathlib.Path("tmp.nc").unlink() - # get just antarctica region and save to disk pygmt.grdsample( processed, @@ -3271,7 +3261,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="http://www.seismolab.org/model/antarctica/lithosphere/AN1-HF.tar.gz", fname="an_2015_.tar.gz", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="9834439cdf99d5ee62fb88a008fa34dbc8d1848e9b00a1bd9cbc33194dd7d402", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -3332,7 +3322,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://store.pangaea.de/Publications/Martos-etal_2017/Antarctic_GHF.xyz", fname="martos_2017.xyz", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="a5814bd0432986e111d0d48bfbd950cce66ba247b26b37f9a7499e66d969eb1f", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -3366,7 +3356,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://doi.org/10.5194/tc-14-3843-2020-supplement", fname="burton_johnson_2020.zip", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="66b1f7acd06eeb6a6362c89b05db07034f510c81e3115cefbd4d11a584f143b2", + known_hash=None, processor=pooch.Unzip(extract_dir="burton_johnson_2020"), progressbar=True, ) @@ -3377,7 +3367,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url=url, fname="ANT_GHF_DB_V004.xlsx", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="192ad3862770de66f7ba82e9bc0bf1156ae3fccaabc76e9791edfb6c8fd4ff5f", + known_hash=None, progressbar=True, ) @@ -3502,7 +3492,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://download.pangaea.de/dataset/930237/files/HF_Min_Max_MaxAbs-1.csv", fname="losing_ebbing_2021_ghf.csv", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="ecdae882083d8eb3503fab5be2ef862c96229f89ecbae1f95e56a8f43fb912e2", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -3536,7 +3526,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://download.pangaea.de/dataset/924857/files/aq1_01_20.nc", fname="aq1.nc", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="946ae69e0a3d15a7500d7252fe0ce4f5cb126eaeb6170555ade0acdc38b86d7f", + known_hash=None, progressbar=True, ) grid = xr.load_dataset(path)["Q"] @@ -3611,7 +3601,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="https://drive.google.com/uc?export=download&id=1Fz7dAHTzPnlytuyRNctk6tAugCAjiqzR", fname="shen_2020_ghf.xyz", path=f"{pooch.os_cache('pooch')}/polartoolkit/ghf", - known_hash="d6164c3680da52f8f03584293b1a271c937852df9a64f3c98d68debc44e02533", + known_hash=None, processor=preprocessing, progressbar=True, ) @@ -3687,7 +3677,7 @@ def gia( url="https://zenodo.org/record/4003423/files/ant_gia_dem_0.tiff?download=1", fname="stal_2020_gia.tiff", path=f"{pooch.os_cache('pooch')}/polartoolkit/gia", - known_hash="cb579c9606f98dfd28239183ba28de33e6e288a4256b27da7249c3741a24b7e8", + known_hash=None, progressbar=True, ) grid = xr.load_dataarray(path).squeeze() @@ -3891,7 +3881,7 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: url="http://www.seismolab.org/model/antarctica/lithosphere/AN1-CRUST.tar.gz", fname="an_2015_crustal_thickness.tar.gz", path=f"{pooch.os_cache('pooch')}/polartoolkit/crustal_thickness", - known_hash="486da67ccbe76bb7f79725981c6078a0429a2cd2797d447702b90302e2b7b1e5", + known_hash=None, progressbar=True, processor=preprocessing, ) @@ -4033,7 +4023,6 @@ def preprocessing(fname: str, action: str, _pooch2: typing.Any) -> str: known_hash=None, progressbar=True, processor=preprocessing, - downloader=pooch.HTTPDownloader(timeout=30), ) grid = xr.load_dataarray(path) diff --git a/templates/CHANGELOG.md.j2 b/templates/CHANGELOG.md.j2 index 2a20a37c..e981027b 100644 --- a/templates/CHANGELOG.md.j2 +++ b/templates/CHANGELOG.md.j2 @@ -4,8 +4,8 @@ Automatically updated by with commit parsing of [angular commits](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits). {% if context.history.unreleased | length > 0 %} {# UNRELEASED #} - ## Unreleased + {% for type_, commits in context.history.unreleased | dictsort %} {% if type_ == "feature" %} ### 🚀 Features @@ -21,8 +21,6 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b ### ✏️ Formatting {% elif type_ == "build" %} ### 📦️ Build -{% elif type_ == "breaking" %} -### 💥 Breaking Changes {% else %} ### Other {% endif%} @@ -41,7 +39,6 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b {% if version in ["0.0.0", "0.0.1", "0.0.3", "0.0.4", "0.0.6"] %} {% else %} {# RELEASED #} - ## {{ version.as_semver_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) {% endif %} {% if version in ["0.0.0", "0.0.1", "0.0.3", "0.0.4", "0.0.6"] %} @@ -61,8 +58,6 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b ### ✏️ Formatting {% elif type_ == "build" %} ### 📦️ Build -{% elif type_ == "breaking" %} -### 💥 Breaking Changes {% else %} ### Other {% endif%} @@ -75,6 +70,7 @@ with commit parsing of [angular commits](https://github.com/angular/angular.js/b * {{ msg_no_ID }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) {% else %} * {{ msg }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) + {% endif %} {% endfor %} {% endfor %} diff --git a/tests/test_fetch.py b/tests/test_fetch.py index c28159ec..6f2fffdb 100644 --- a/tests/test_fetch.py +++ b/tests/test_fetch.py @@ -1073,8 +1073,8 @@ def test_basal_melt(test_input, expected): ( 5000, (-3330000.0, 3330000.0, -3330000.0, 3330000.0), - 26.5547351837, - 102.389022827, + 26.4593582153, + 102.412307739, "g", ), ), @@ -1121,7 +1121,7 @@ def test_ghf(test_input, expected): utils.get_grid_info(grid), expected, ignore_order=True, - significant_digits=0, + significant_digits=2, )