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

MNT: Bring in recent changes from main to the 2.0 branch #1623

Open
wants to merge 115 commits into
base: release/2.0
Choose a base branch
from

Conversation

mgrover1
Copy link
Collaborator

@mgrover1 mgrover1 commented Aug 29, 2024

Bring in recent changes to main

  • Tests added
  • Documentation reflects changes

syedhamidali and others added 30 commits September 18, 2023 14:40
* FIX: Add isinstance checks to improve linting

* FIX: Update the installation instructions

* FIX: Update python versions

* FIX: Update master to main in contributors guide
* FIX: Add isinstance checks to improve linting

* ADD: Add suite of new utilities to xradar accessor

* ADD: Add new xradar tests
* FIX: Add isinstance checks to improve linting

* ADD: Add support for gridding from the xradar object

* FIX: Fix failing tests

* FIX: Cleanup the type hinting

* FIX: Use allclose instead of assert equal
* DOC: Add docs for xradar and Py-ART

* DOC: Add docs on using xradar with Py-ART

* FIX: Fix small bugs
* ADD: Add dealias example with xradar

* Fix misspelling of velocities
* ADD: Add python 3.12 to ci and wheels

* ADD: Add additional docs on updated python versions
* ENH: Update for column vertical profile subset

* ENH: inclusion of column_vertical_profile

* ENH: inclusion of column_vertical_profile and associated functions

* ENH: Addition of tests for column_vertical_profile

* ENH: Linting corrections to columnsect. used ruff

* ENH: linting corrections to test_columnsect; used ruff

* ENH: Pre-commit linting corrections

* ENH: Pre-commit linting corrections

* ENH: Further columnsect linting corrections

* ENH: removal of trailing whitespace..

* ENH: testing why pre-commit is giving me linting issues

* ENH: Requested Corrections

* MNT: Few more docstring changes.

* CI: Temporary pin python 3.11 until datattree does a release.

* Remove python version pin

* FIX: Upgrade the version of precommit linter

* update python v

---------

Co-authored-by: zssherman <[email protected]>
Co-authored-by: Max Grover <[email protected]>
* FIX: Fix python version used in CI system

* FIX: Fix incorrect arg in ci workflow

* DEL: Remove pinning of libnetcdf
* ADD: Xarray to Py-ART Grid interface

* FIX: Pre-commit hooks

* DOC: Parameters for Xgrid

* ADD: Close dataset to test_accessor

---------

Co-authored-by: Robert Jackson <[email protected]>
* FIX: Fix python version used in CI system

* FIX: Fix incorrect arg in ci workflow

* DEL: Remove pinning of libnetcdf

* FIX: Fix when sweep_name is an empty attribute

* FIX: Add more robust check
* Create precip_rate.py

* Update __init__.py

* Create test_precip_rate.py

* Update precip_rate.py

* Linting formatting

* Update test_precip_rate.py

* Update test_precip_rate.py

* Move functions and change math to numpy

* Update formatting

* Update formatting

* FIX: Fix the testing suite to avoid nans

---------

Co-authored-by: mgrover1 <[email protected]>
* Rename functions and variables to remove "convective-stratiform"

We want to make this function more generic so it can be used on a wide variety of fields and not just to detect convective and stratiform elements. I renamed most of the functions and some of the variables to reflect this and hopefully make it easier to use.

* Add new reference

* Incorporate binary closing option to functions

* Add author to functions

* Slight reformat for linting

* More linting formatting

* Add alternate option for getting under/over estimate field

* Create plot_feature_detection.py

* Delete plot_convective_stratiform.py

* Update echo_class.py

* Update plot_feature_detection.py

* Update plot_feature_detection.py

* Update test_echo_class.py

* Keep original function and add warning

* Revert "Delete plot_convective_stratiform.py"

This reverts commit 2bff81a.

* Update __init__.py

* Update echo_class.py

* Update dictionary keys

* Update plot_convective_stratiform.py

* Fix issues

* Update plot_convective_stratiform.py
* FIX: change deprecated np.str in arm_vpt to str

* Update default wind_size in calculate_velocity_texture from 4 to 3
Using an odd number prevents single index offsets in placement in
case of an even size

* ADD: optional rectangular window dims for velocity texture analysis.
Also, modify the default window size to 3 instead of the previous
value of 4 (even number resulting in a potential offset).

* FIX: nyquist velocity dtype in radar obj loaded with read_kazr

* pep8

* line reformatting per black

* TST: unit tests for rectangular texture window

* STY: linting (black)

* FIX: Add in linting fixes

* FIX: metadata in core.radar.get_elevation

---------

Co-authored-by: mgrover1 <[email protected]>
* FIX: change deprecated np.str in arm_vpt to str

* Update default wind_size in calculate_velocity_texture from 4 to 3
Using an odd number prevents single index offsets in placement in
case of an even size

* ADD: optional rectangular window dims for velocity texture analysis.
Also, modify the default window size to 3 instead of the previous
value of 4 (even number resulting in a potential offset).

* FIX: nyquist velocity dtype in radar obj loaded with read_kazr

* pep8

* line reformatting per black

* TST: unit tests for rectangular texture window

* STY: linting (black)

* FIX: Add in linting fixes

* FIX: metadata in core.radar.get_elevation

* FIX: outdated text in masking_data_with_gatefilters.ipynb

---------

Co-authored-by: mgrover1 <[email protected]>
* FIX: change deprecated np.str in arm_vpt to str

* Update default wind_size in calculate_velocity_texture from 4 to 3
Using an odd number prevents single index offsets in placement in
case of an even size

* ADD: optional rectangular window dims for velocity texture analysis.
Also, modify the default window size to 3 instead of the previous
value of 4 (even number resulting in a potential offset).

* FIX: nyquist velocity dtype in radar obj loaded with read_kazr

* pep8

* line reformatting per black

* TST: unit tests for rectangular texture window

* STY: linting (black)

* FIX: Add in linting fixes

* FIX: metadata in core.radar.get_elevation

* FIX: outdated text in masking_data_with_gatefilters.ipynb

* ADD: method to automatically determine sweep number and sweep start and end indices

* add comment to 'determine_sweeps' method

* FIX: indexing bug in 'determine_sweeps' method

* ADD: unit tests for 'determine_sweeps'

* linting

* FIX: nsweeps wasn't updated when calling 'determine_sweeps'; tests were updated accordingly

* line reformatting per black

* FIX: update multiple radar object attributes to ensure its full utilization with Py-ART after 'determine_sweeps' is called

* line reformatting per black

* linting

* ENH: add antenna_transition to the testing module's sample objects

* ENH: update unit tests to reflect antenna_transition allocation in sample_objects

* Update pyart/util/radar_utils.py

Co-authored-by: Max Grover <[email protected]>

* Update pyart/util/radar_utils.py

Co-authored-by: Max Grover <[email protected]>

---------

Co-authored-by: mgrover1 <[email protected]>
* Update rainbow_wrl.py

Prevent program from crashing when bins changes between sweeps.

* ADD: Add new properties for _range in rainbow_wrl.py

Add two properties, "meters_between_gates" and "meters_to_center_of_first_gate", required by the uf format file.

* Update rainbow_wrl.py

Raise error when range resolution changes between sweeps.

* refactor: Fix linting

* refactor: Fix linting
* ADD: _echo_class_wt.py: RadarEchoClass module with all methods/code from PyREClass.

* ADD:wrapper function for wt_reclass

* REFORMAT: Function names comply with PyART & PEP8 standards.

* REFORMAT: Function names comply with PyART & PEP8 standards.

* Revert "REFORMAT: Function names comply with PyART & PEP8 standards."

This reverts commit 6ce7cc8.

* REFORMAT: Function names comply with PyART & PEP8 standards.

* ADD: masked array, detailed func arguments

* MOD:func user arguments used,class num changed.

* DOC:function and user arguments.

* MOD: added metadata to field dictinery.

* order of classes changed

* cappi level added;better description of calsses

* REFORMAT: PEP8 style

* FORMAT:PEP8

* MOD:sanity check for conv core threshold

* MOD:More sanity check for thresholds

* MOD:Added override to sanity check+documentation

* MOD:minor

* invalid grid raises exception

* first unit test added

* ADD:func make_gaussian_storm_grid

* ADD: test for  output validity

* ADD:utest for results of classification

* ENH: test documentation and apply black formatting

* ENH:small test func  merged;name change

* ADD: Stat-based tests for Gaussian storm grid function

* ADD: example

* FORMAT:Black

* FIX: issues for #1495 the code review

- aded TypeError handling in `_echo_class_wt.py`
- Left tab docstring in `echo_class.py`
- Added blank line in `_echo_class_wt.py`
- Did not check `reflectivity_to_rainrate` function for duplication
- Spellcheck Done
- Confirmed grid object check in `echo_class.py`
- Added `#noqa` comment in `__init__.py`

* FIX:unused imports andvariables removed

* Removed two line func sum_conv_wavelets();

* minor

* Removed reflectivity_to_rainrate()

* Test PAssed reflectivity_to_rainrate():

* minor:autosummary

* ADD:conv_wavelet_sum()

* Func Renamed: get_reclass -> wavelet_reclas

* Refined documentation and Descriptive user arguments

* FMT: Black

* ENH:Docstring

* DOC:Better description & ordering  of classification categories

* REFACTOR:scale_break now computed in calling function

Moved scale break calculation to calling function, outputting scale_break as a parameter for the user. Adjusted related functions and variables.

* ENH:scale_break is adaptive to resolution

* ENH:atol added, tests default function arguments

* FROMAT:black

* MINOR:corrected tab in docstring

* used new scaling and added description

* MINOR: alignment in docstring

* FORAMT:linting error corrected

* 'LINTING ERR:import-block sorted;extra'()' removed'

Follwing errors are fixed:
pyart/retrieve/_echo_class_wt.py:192:26: UP034 [*] Avoid extraneous parentheses
pyart/retrieve/echo_class.py:6:1: I001 [*] Import block is un-sorted or un-formatted
Found 2 errors.
[*] 2 fixable with the `--fix` option.
Error: Process completed with exit code 1.

* FIX: Fix linting error

* FIX: Fix more linting errors

* DOCS:minor docstrig chages from Zach

* DOCS: testing precommit

---------

Co-authored-by: mgrover1 <[email protected]>
Co-authored-by: Max Grover <[email protected]>
* FIX: change deprecated np.str in arm_vpt to str

* Update default wind_size in calculate_velocity_texture from 4 to 3
Using an odd number prevents single index offsets in placement in
case of an even size

* ADD: optional rectangular window dims for velocity texture analysis.
Also, modify the default window size to 3 instead of the previous
value of 4 (even number resulting in a potential offset).

* FIX: nyquist velocity dtype in radar obj loaded with read_kazr

* pep8

* line reformatting per black

* TST: unit tests for rectangular texture window

* STY: linting (black)

* FIX: Add in linting fixes

* FIX: metadata in core.radar.get_elevation

* FIX: outdated text in masking_data_with_gatefilters.ipynb

* ADD: method to automatically determine sweep number and sweep start and end indices

* add comment to 'determine_sweeps' method

* FIX: indexing bug in 'determine_sweeps' method

* ADD: unit tests for 'determine_sweeps'

* linting

* FIX: nsweeps wasn't updated when calling 'determine_sweeps'; tests were updated accordingly

* line reformatting per black

* FIX: update multiple radar object attributes to ensure its full utilization with Py-ART after 'determine_sweeps' is called

* line reformatting per black

* linting

* ENH: add antenna_transition to the testing module's sample objects

* ENH: update unit tests to reflect antenna_transition allocation in sample_objects

* Update pyart/util/radar_utils.py

Co-authored-by: Max Grover <[email protected]>

* Update pyart/util/radar_utils.py

Co-authored-by: Max Grover <[email protected]>

* ENH: add 'zdist_factor' input parameter to 'map_gates_to_grid'.
This parameter scales the distance in the z-dimension when calculating
weights upon gridding. It is a semi-equivalent to the scaling factors in
the RoI class methods. Example for using this parameter would be setting
a 'zdist_factor' value of 0.0 combined with an h_factor=0.0 (if calling
DistBeamRoI) or z_factor=0.0 (if calling DistRoI), resulting in the
exclusion of the z dimension in gridding weighting, which could serve as
a potential solution for gridding a single PPI sweep from a single radar.
In that case, the distance in the weighting function effectively serves as
the distance of a given point from the PPI sweep's cone.

* DEL: remove a redundant (liekly residual) input parameter (toa) from map_gates_to_grid

* MNT: set a consistent nomenclature for the distance squared parameter.
In parts of the 'map_grid' method it was referred to as 'dist' whereas
in another as 'dist2' (parameter calculation lines differ in style but
identical in value), resulting in an unnecessary scalar allocation,
and a confusing nomenclature.

* DOC: Add example for gridding data

* Update pyart/map/gates_to_grid.py

Co-authored-by: Max Grover <[email protected]>

---------

Co-authored-by: mgrover1 <[email protected]>
* Create cfad.py

* Update __init__.py

* Create test_cfad.py

* Create plot_cfad.py

* Update plot_cfad.py

* Update plot_feature_detection.py

* Update cfad.py

* Update test_cfad.py

* Update plot_cfad.py

* linting updates

* linting update

* Update to use grid or radar object

* corrections

* update example

* Update test_cfad.py

* Update test_cfad.py

* Update test_cfad.py

* add spaces

---------

Co-authored-by: Zach Sherman <[email protected]>
Update the code quality actions
mgrover1 and others added 5 commits August 8, 2024 09:57
…#1616)

* class names added to the documentation

* example added

* description

* description refined

* Corrected spelling/punctuations
* ADD: Add reference for compute_cdf

* ADD: Add reference for computations

* ADD: Add qpe references
…g in hydroclass_semisupervised (#1618)

* ENH: addition of qvp functions from MeteoSwiss Py-ART + entropy computation in hydroclass_semisupervised

* FIX: fixing est_rain_rate_hydro to match ARM original

* ENH: black formatting

* FIX: modified pyart examples to handle new hydroclass_semisupervised output

* FIX: fix in plot_hydrometeor_class_x_band.py example which was using wrong hydroclass labels

* ENH: updated defaut_config.py to account for new outputs of hydroclass_semisupervised

* FIX: adapted hydroclass_semisupervised to account for specified radar_freq

* FIX: adapted hydroclass_semisupervised to account for specified radar_freq

* ADD: new tests for missing fcts

* ENH: add support for more scan modes in qvp fcts

* FIX: docstring correction in cartesian_to_antenna

* FIX: missing hydrometeor variables in default_config.py

* fixes to make tests pass

* fixes to make tests pass

* FIX: changed value in ZDR standardization from -5 to 5 to -1.5 to 5 according to Besic (2016)
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

mgrover1 and others added 23 commits August 29, 2024 12:50
* ADD: Add to_radar() method

* FIX: Fix the examples to use new to_radar() interface
* ADD: Adding cloud mask code.

* MNT: Update change suggested by max.

Co-authored-by: Max Grover <[email protected]>

---------

Co-authored-by: Max Grover <[email protected]>
* FIX: Add local install of pyart to doc env file

Add a local install of pyart to docs environment

* Update environment.yml
* ENH: xarray grid compatibility

* ENH: xarray grid output

* adding back xarray availablity check

* pre-commit run

* fix minor error in grid_to_xarary

* modified coords in function to_xarray()

* modified coords in function to_xarray() + pre-commit

* Add plot_max_cappi example and update related modules

* Update tests and fix Example

* drop a few  args

* Fix grid.to_xarray()

* FIX: Fixed some tests and to_xarray() function

* FIX: Fixed to_xarray() for more than one radar

---------

Co-authored-by: Zach Sherman <[email protected]>
* ADD: Adding cloud mask example.

* MNT: Wrong field.
* DOC: Add pyart 2.0 migration guide

* ADD: Add revised structure to py-art 2.0
* ADD: Add cartopy as a dependency

* ADD: Add cartopy in readme as dependency

* FIX: Remove skipping test for not install cartopy

* FIX: Remove last couple mentions of cartopy and test locally
* ADD: ZDR bias calculations from Radtraq

* ADD: Example for gallery

* ADD: ZDR bias calculations

* FIX: Revert back for spectra_calculations.py

* FIX: Restore phase proc from main branch

* STY: Black and ruff changes.

* FIX: Duplicate entries in __init__ and obj to radar

* FIX: Reinsert calc_bias

* FIX: Never mind, there were two calc_biases

---------

Co-authored-by: Zach Sherman <[email protected]>
…1641)

Bumps the actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.9.0 to 1.10.0
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* FIX: Minor fix in plot_maxcappi

* Update pyart/graph/max_cappi.py

Co-authored-by: Zach Sherman <[email protected]>

* FIX: Remove un-necessary commented lines

---------

Co-authored-by: Zach Sherman <[email protected]>
* ADD: New function to create a CAPPI product

* FIX: Fixed some minor errors

* FIX: Citation

* FIX: Added  AMS Glossary citation

* ADD: Added example of PPI vs CAPPI

---------

Co-authored-by: Max Grover <[email protected]>
…1644)

Bumps the actions group with 1 update: [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/gh-action-pypi-publish` from 1.10.0 to 1.10.1
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ons group (#1648)

* Build(deps): Bump pypa/cibuildwheel in the actions group

Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel).


Updates `pypa/cibuildwheel` from 2.20.0 to 2.21.0
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v2.20.0...v2.21.0)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>

* FIX: Add missing txt files for colormaps in MANIFEST.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: zssherman <[email protected]>
)

* FIX: Fix errors in docstrings and comments in CAPPI and MAX_CAPPI

* Update pyart/graph/max_cappi.py

Co-authored-by: Zach Sherman <[email protected]>

* Update pyart/graph/max_cappi.py

Co-authored-by: Zach Sherman <[email protected]>

---------

Co-authored-by: Zach Sherman <[email protected]>
Bumps the actions group with 2 updates: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish).


Updates `pypa/cibuildwheel` from 2.21.0 to 2.21.1
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v2.21.0...v2.21.1)

Updates `pypa/gh-action-pypi-publish` from 1.10.1 to 1.10.2
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* ADD: Transparency options for geotiff writer

* FIX: Format input block

* FIX: Format import block

* FIX: PEP8 format fixes

* STY: Update PEP8 formatting.

---------

Co-authored-by: Zach Sherman <[email protected]>
Co-authored-by: zssherman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.