Skip to content

Commit

Permalink
Merge branch 'development' into callout-on-nonfunctional-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 authored Aug 14, 2024
2 parents d664b80 + f2ad0a8 commit cb195f9
Show file tree
Hide file tree
Showing 28 changed files with 243 additions and 212 deletions.
41 changes: 0 additions & 41 deletions .flake8

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/linter_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run black linter
uses: psf/black@stable
# use the flake8 linter to annotate improperly formatted code
# note linter arguments are supplied via the .flake8 config file
- name: Annotate PR after running flake8
uses: TrueBrain/actions-flake8@v2

# Use the Ruff linter to annotate code style / best-practice issues
# NOTE: More config provided in pyproject.toml
- name: Lint and annotate PR
uses: chartboost/ruff-action@v1
with:
args: "check . --output-format github"
25 changes: 14 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: black
- id: check-toml
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # Use the ref you want to point at
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
hooks:
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

ci:
autoupdate_schedule: monthly
Expand Down
10 changes: 9 additions & 1 deletion doc/source/user_guide/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ This is the list of changes made to icepyx in between each release.
Full details can be found in the `commit logs <https://github.com/icesat2py/icepyx/commits>`_.


Latest Release (Version 1.1.0)
Latest Release (Version 1.2.0)
------------------------------

.. toctree::
:maxdepth: 2

v1.2.0

Version 1.1.0
-------------

.. toctree::
:maxdepth: 2

Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/changelog/v1.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ Other
Contributors
~~~~~~~~~~~~

.. contributors:: v0.4.0..v0.4.1|HEAD
.. contributors:: v1.0.0..v1.1.0|HEAD
41 changes: 41 additions & 0 deletions doc/source/user_guide/changelog/v1.2.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
What's new in 1.2.0 (14 August 2024)
-----------------------------------

These are the changes in icepyx 1.2.0 See :ref:`release` for a full changelog
including other versions of icepyx.


New Features
~~~~~~~~~~~~

- Replace `setup.py` with equivalent `pyproject.toml` (#539)
- Fix continuous delivery & docs to account for setup.py -> pyproject.toml change (#541)


Bug fixes
~~~~~~~~~

- Switch to set comparison to fix a test dependent on unreliable order (#550)



Maintenance
^^^^^^^^^^^

- update docstring tests for numpy 2.0 (#537)
- Add Zenodo badge and update all-contributors badge (#536)
- Autofix flake8 ignores E711, E712, E714, F401, F841 with Ruff (#542)
- Switch to ruff (#543)


Documentation
^^^^^^^^^^^^^

- fix bib entry (#529)
- [docs] update is2 resources (#535)


Contributors
~~~~~~~~~~~~

.. contributors:: v1.1.0..v1.2.0|HEAD
1 change: 1 addition & 0 deletions doc/sphinxext/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
$ ./scripts/announce.py $GITHUB v1.11.0..v1.11.1 > announce.rst
"""

import codecs
import os
import re
Expand Down
1 change: 0 additions & 1 deletion icepyx/core/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import copy
import datetime
import warnings

import earthaccess
from icepyx.core.exceptions import DeprecationError
Expand Down
2 changes: 1 addition & 1 deletion icepyx/core/granules.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def place_order(
# DevGoal: use the request response/number to do some error handling/
# give the user better messaging for failures
# print(request.content)
root = ET.fromstring(request.content)
# root = ET.fromstring(request.content)
# print([subset_agent.attrib for subset_agent in root.iter('SubsetAgent')])

if verbose is True:
Expand Down
21 changes: 12 additions & 9 deletions icepyx/core/is2ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ def _validate_OA_product(product):
"""
if isinstance(product, str):
product = str.upper(product)
assert product in [
"ATL06",
"ATL07",
"ATL08",
"ATL10",
"ATL12",
"ATL13",
], "Oops! Elevation visualization only supports products ATL06, ATL07, ATL08, ATL10, ATL12, ATL13; please try another product."
assert (
product
in [
"ATL06",
"ATL07",
"ATL08",
"ATL10",
"ATL12",
"ATL13",
]
), "Oops! Elevation visualization only supports products ATL06, ATL07, ATL08, ATL10, ATL12, ATL13; please try another product."
else:
raise TypeError("Please enter a product string")
return product
Expand Down Expand Up @@ -159,7 +162,7 @@ def get_varlist(elem):

get_varlist(root)
vars_vals = [
v.replace(":", "/") if v.startswith("/") == False else v.replace("/:", "")
v.replace(":", "/") if v.startswith("/") is False else v.replace("/:", "")
for v in vars_raw
]
cust_options.update({"variables": vars_vals})
Expand Down
13 changes: 7 additions & 6 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import geopandas as gpd
import matplotlib.pyplot as plt
from pathlib import Path # used in docstring tests
import pprint

import icepyx.core.APIformatting as apifmt
Expand Down Expand Up @@ -103,9 +102,10 @@ class GenQuery:
Initializing Query with a geospatial polygon file.
>>> aoi = str(Path('./doc/source/example_notebooks/supporting_files/simple_test_poly.gpkg').resolve())
>>> from pathlib import Path
>>> aoi = Path('./doc/source/example_notebooks/supporting_files/simple_test_poly.gpkg').resolve()
>>> reg_a_dates = ['2019-02-22','2019-02-28']
>>> reg_a = GenQuery(aoi, reg_a_dates)
>>> reg_a = GenQuery(str(aoi), reg_a_dates)
>>> print(reg_a)
Extent type: polygon
Coordinates: [-55.0, 68.0, -55.0, 71.0, -48.0, 71.0, -48.0, 68.0, -55.0, 68.0]
Expand Down Expand Up @@ -378,9 +378,10 @@ class Query(GenQuery, EarthdataAuthMixin):
Initializing Query with a geospatial polygon file.
>>> aoi = str(Path('./doc/source/example_notebooks/supporting_files/simple_test_poly.gpkg').resolve())
>>> from pathlib import Path
>>> aoi = Path('./doc/source/example_notebooks/supporting_files/simple_test_poly.gpkg').resolve()
>>> reg_a_dates = ['2019-02-22','2019-02-28']
>>> reg_a = Query('ATL06', aoi, reg_a_dates)
>>> reg_a = Query('ATL06', str(aoi), reg_a_dates)
>>> print(reg_a)
Product ATL06 v006
('polygon', [-55.0, 68.0, -55.0, 71.0, -48.0, 71.0, -48.0, 68.0, -55.0, 68.0])
Expand Down Expand Up @@ -1132,7 +1133,7 @@ def visualize_spatial_extent(
gdf = self._spatial.extent_as_gdf

try:
from shapely.geometry import Polygon
from shapely.geometry import Polygon # noqa: F401
import geoviews as gv

gv.extension("bokeh")
Expand Down
2 changes: 1 addition & 1 deletion icepyx/core/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import earthaccess
import numpy as np
from s3fs.core import S3File
import xarray as xr

from icepyx.core.auth import EarthdataAuthMixin
Expand Down Expand Up @@ -634,6 +633,7 @@ def load(self):
) # wanted_groups, vgrp.keys()))

# Closing the file prevents further operations on the dataset
# from s3fs.core import S3File
# if isinstance(file, S3File):
# file.close()

Expand Down
Loading

0 comments on commit cb195f9

Please sign in to comment.