forked from UXARRAY/uxarray
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'UXARRAY:main' into main
- Loading branch information
Showing
97 changed files
with
10,953 additions
and
2,819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,10 @@ jobs: | |
python -m pytest test -v --cov=./uxarray --cov-report=xml | ||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected] | ||
if: github.repository == 'UXARRAY/uxarray' | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5.0.0 | ||
- uses: actions/setup-python@v5.1.0 | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5.0.0 | ||
uses: actions/setup-python@v5.1.0 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
|
@@ -34,7 +34,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5.0.0 | ||
uses: actions/setup-python@v5.1.0 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
|
@@ -50,7 +50,7 @@ jobs: | |
python -m twine check dist/* | ||
- name: Publish package to PyPI | ||
uses: pypa/[email protected].11 | ||
uses: pypa/[email protected].14 | ||
with: | ||
skip-existing: true | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
include LICENSE | ||
include README.md | ||
|
||
recursive-include uxarray *.py | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
exclude .gitignore | ||
exclude .pre-commit-config.yaml | ||
exclude .readthedocs.yml | ||
|
||
include *.md | ||
include *.toml | ||
include *.txt | ||
prune test* | ||
prune ci* | ||
prune .github* | ||
prune docs* | ||
prune benchmarks* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import uxarray as ux | ||
|
||
current_path = Path(os.path.dirname(os.path.realpath(__file__))).parents[0] | ||
|
||
grid_quad_hex = current_path / "test" / "meshfiles" / "ugrid" / "quad-hexagon" / "grid.nc" | ||
grid_geoflow = current_path / "test" / "meshfiles" / "ugrid" / "geoflow-small" / "grid.nc" | ||
grid_scrip = current_path / "test" / "meshfiles" / "scrip" / "outCSne8" / "outCSne8.nc" | ||
grid_mpas= current_path / "test" / "meshfiles" / "mpas" / "QU" / "oQU480.231010.nc" | ||
|
||
|
||
|
||
class FaceBounds: | ||
|
||
params = [grid_quad_hex, grid_geoflow, grid_scrip, grid_mpas] | ||
|
||
|
||
def setup(self, grid_path): | ||
self.uxgrid = ux.open_grid(grid_path) | ||
|
||
def teardown(self, n): | ||
del self.uxgrid | ||
|
||
def time_face_bounds(self, grid_path): | ||
"""Time to obtain ``Grid.face_bounds``""" | ||
self.uxgrid.bounds | ||
|
||
def peakmem_face_bounds(self, grid_path): | ||
"""Peak memory usage obtain ``Grid.face_bounds.""" | ||
face_bounds = self.uxgrid.bounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import os | ||
import urllib.request | ||
from pathlib import Path | ||
|
||
import uxarray as ux | ||
|
||
current_path = Path(os.path.dirname(os.path.realpath(__file__))) | ||
|
||
data_var = 'bottomDepth' | ||
|
||
grid_filename_480 = "oQU480.grid.nc" | ||
data_filename_480 = "oQU480.data.nc" | ||
|
||
grid_filename_120 = "oQU120.grid.nc" | ||
data_filename_120 = "oQU120.data.nc" | ||
|
||
filenames = [grid_filename_480, data_filename_480, grid_filename_120, data_filename_120] | ||
|
||
for filename in filenames: | ||
if not os.path.isfile(current_path / filename): | ||
# downloads the files from Cookbook repo, if they haven't been downloaded locally yet | ||
url = f"https://github.com/ProjectPythia/unstructured-grid-viz-cookbook/raw/main/meshfiles/{filename}" | ||
_, headers = urllib.request.urlretrieve(url, filename=current_path / filename) | ||
|
||
|
||
file_path_dict = {"480km": [current_path / grid_filename_480, current_path / data_filename_480], | ||
"120km": [current_path / grid_filename_120, current_path / data_filename_120]} | ||
|
||
|
||
class Gradient: | ||
|
||
param_names = ['resolution'] | ||
params = ['480km', '120km'] | ||
|
||
|
||
def setup(self, resolution): | ||
self.uxds = ux.open_dataset(file_path_dict[resolution][0], file_path_dict[resolution][1]) | ||
|
||
def teardown(self, resolution): | ||
del self.uxds | ||
|
||
def time_gradient(self, resolution): | ||
self.uxds[data_var].gradient() | ||
|
||
def peakmem_gradient(self, resolution): | ||
grad = self.uxds[data_var].gradient() | ||
|
||
class Integrate: | ||
|
||
param_names = ['resolution'] | ||
params = ['480km', '120km'] | ||
|
||
|
||
def setup(self, resolution): | ||
self.uxds = ux.open_dataset(file_path_dict[resolution][0], file_path_dict[resolution][1]) | ||
|
||
def teardown(self, resolution): | ||
del self.uxds | ||
|
||
def time_integrate(self, resolution): | ||
self.uxds[data_var].integrate() | ||
|
||
def peakmem_integrate(self, resolution): | ||
integral = self.uxds[data_var].integrate() | ||
|
||
class GeoDataFrame: | ||
|
||
param_names = ['resolution', 'exclude_antimeridian'] | ||
params = [['480km', '120km'], | ||
[True, False]] | ||
|
||
|
||
def setup(self, resolution, exclude_antimeridian): | ||
self.uxds = ux.open_dataset(file_path_dict[resolution][0], file_path_dict[resolution][1]) | ||
|
||
def teardown(self, resolution, exclude_antimeridian): | ||
del self.uxds | ||
|
||
def time_to_geodataframe(self, resolution, exclude_antimeridian): | ||
self.uxds[data_var].to_geodataframe(exclude_antimeridian=exclude_antimeridian) | ||
|
||
def peakmem_to_geodataframe(self, resolution, exclude_antimeridian): | ||
gdf = self.uxds[data_var].to_geodataframe(exclude_antimeridian=exclude_antimeridian) | ||
|
||
|
||
class ConnectivityConstruction: | ||
|
||
param_names = ['resolution'] | ||
params = ['480km', '120km'] | ||
|
||
|
||
def setup(self, resolution): | ||
self.uxds = ux.open_dataset(file_path_dict[resolution][0], file_path_dict[resolution][1]) | ||
|
||
def teardown(self, resolution): | ||
del self.uxds | ||
|
||
def time_n_nodes_per_face(self, resolution): | ||
self.uxds.uxgrid.n_nodes_per_face |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.