Skip to content

Commit

Permalink
Merge branch 'main' into philipc2/grid-chunking
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 authored Sep 3, 2024
2 parents aed223a + 82e46b8 commit d54d92e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# allow installing from git archives
.git_archival.txt export-subst
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5.1.1
- uses: actions/setup-python@v5.2.0
- uses: pre-commit/[email protected]
6 changes: 3 additions & 3 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.1.1
uses: actions/setup-python@v5.2.0
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -50,7 +50,7 @@ jobs:
python -m twine check dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
skip-existing: true
verbose: true
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cff-version: 1.2.0
message: "If you use the UXarray software, please cite it as below."
message: "If you use the UXarray software, please cite it as suggested here."
authors:
- family-names: "Chen"
given-names: "Amber"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="/docs/_static/images/logos/uxarray_logo_h_light.svg">
<source media="(prefers-color-scheme: light)" srcset="/docs/_static/images/logos/uxarray_logo_h_dark.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/UXARRAY/uxarray/e252a7669acc6a733bca14ac244bbf02e665dbb0/docs/_static/images/logos/uxarray_logo_h_light.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/UXARRAY/uxarray/e252a7669acc6a733bca14ac244bbf02e665dbb0/docs/_static/images/logos/uxarray_logo_h_dark.svg">
<img alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png" width="450">
</picture>

Expand Down
6 changes: 4 additions & 2 deletions uxarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ def to_geodataframe(self, override=False, cache=True, exclude_antimeridian=False
exclude_antimeridian=exclude_antimeridian,
)

var_name = self.name if self.name is not None else "var"

if exclude_antimeridian:
gdf[self.name] = np.delete(
gdf[var_name] = np.delete(
self.values, self.uxgrid.antimeridian_face_indices, axis=0
)
else:
gdf[self.name] = self.values
gdf[var_name] = self.values
return gdf

elif self.values.size == self.uxgrid.n_node:
Expand Down
8 changes: 6 additions & 2 deletions uxarray/plot/dataarray_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ def _polygon_raster(
exclude_antimeridian=exclude_antimeridian, cache=cache, override=override
)

hv_polygons = hv.Polygons(gdf, vdims=[uxda.name])
hv_polygons = hv.Polygons(
gdf, vdims=[uxda.name if uxda.name is not None else "var"]
)

uxarray.plot.utils.backend.assign(backend=backend)

Expand Down Expand Up @@ -393,7 +395,9 @@ def polygons(
exclude_antimeridian=exclude_antimeridian, cache=cache, override=override
)

hv_polygons = hv.Polygons(gdf, vdims=[uxda.name])
hv_polygons = hv.Polygons(
gdf, vdims=[uxda.name if uxda.name is not None else "var"]
)

uxarray.plot.utils.backend.assign(backend=backend)
if backend == "matplotlib":
Expand Down

0 comments on commit d54d92e

Please sign in to comment.