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

Cleanup ndsl/dsl/dace/utils.py #96

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

romanc
Copy link
Collaborator

@romanc romanc commented Jan 6, 2025

Description

Fixing typos, adding type hints, and sight simplifications in ndsl/dsl/dace/utils.py.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included

Roman Cattaneo added 2 commits January 6, 2025 15:11
Adding type hints allowed to simplify `kernel_theoretical_timing`.
@romanc romanc force-pushed the romanc/cleanup-dace-utils branch from 5020546 to d4e065c Compare January 6, 2025 14:12
@romanc romanc merged commit 4e06ee8 into NOAA-GFDL:develop Jan 7, 2025
5 checks passed
@romanc romanc deleted the romanc/cleanup-dace-utils branch January 7, 2025 16:12
fmalatino added a commit that referenced this pull request Jan 24, 2025
* updating 4d handling

* debug 4d test data

* more iter

* moving ser_to_nc here

* updating datatype in translate test

* typing works

* fix dict, lint

* remove empty line

* change from 4d to Nd

* Expose `k_start` and `k_end` automatically for any FrozenStencil

* Fix k_start + utest

* lint

* Fix for 2d stencils

* Add threshold overrides to the multimodal metric

* Always report results, add summary with one liners

* Remove "mmr" from the keys

* README in testing

* Better Latex (?)

* Better Latex (?)

* fixing a typo that breaks bools in translate tests (#80)

* Fix summary filename

* Fix report, filename

* Fix choosing right absolute difference for F32

* Make robust for NaN value

* Detect when array have different dimensions, if only one dimension, collapse
Clean up type infer and log work

* Lint

* Add rank 0 to the data

* Check data exists for rank, skip & print if not

* Fix bad logic on skip test for parallel

* Verbose exported names

* Make boilerplate calls more nimble

* New option: `which_savepoint`
Better error on bad output data
Fix missing integer type check

* QOL for mypy/flak8 type hints

* Add SECONDS_PER_DAY as a constants following mixed precision standards

* Lint

* Cleanups in dace orchestration

Readability improvements in dace orchestration including

- early returns
- spelling out variable names
- fixing typos

* Rename program -> dace_program

* Make sure all constants adhere to the floating point precision set by the system

* Move `is_float` to `dsl.typing`

* Move Quantity to sub-directory + breakout the subcomponent

* Fix tests

* Lint

* Remove `cp.ndarray` since cupy is optional

* Restore workaround for optional cupy

* "GFS" -> "UFS"

* Cupy trick for metadata

* Add comments for constant explanation

* Describe 64/32-bit FloatFields

* Make sure the `make_storage_data` respects the array dtype.

* Fix logic for MultiModal metric and verbose it

* Added an MPI all_reduce for quantities based on SUM operation to communicator.py

* linted

* Add initial skeleton of pytest test for all reduce

* Added assertion tests for 1, 2 and 3D quantities passed through mpi_allreduce_sum

* Linted

* Added pytest.mark to skip test if mpi4py isn't available

* lint changes

* Addressed PR comments and added additional CPU backends to unit test

* Added setters for various Quantity properties to enable setting of Quantity metadata and data properties.

* Added function in QuantityMetadata class that allows copying of Metadata properties from one class to another.  Subsequent Quantity setters that performed the copying of QuantityMetadata properties were removed

* Expose all SG metric terms in grid_data

* Add `Allreduce` and all MPI OP

* Update utest

* Fix `local_comm`

* Fix utest

* Enforce `comm_abc.Comm` into Communicator

* Fix `comm` object in serial utest

* Lint + `MPIComm` on testing architecture

* Make sure the correct allocator backend is used for Quantities

* Add in_place option for Allreduce

* Cleanup ndsl/dsl/dace/utils.py (#96)

* Fix typos
* DaCeProgress: avoid double assignment of prefix
* Add type hints/simplify kernel_theoretical_timing

Adding type hints allowed to simplify `kernel_theoretical_timing`.

* Fix merge

* Hotfix for grid generation use of mpi operators

* Merge examples/mpi/.gitignore into top-level .gitignore

* Remove hard-coded __version__ numbers

Removes hard-coded version numbers from `__init__` files.

* Fixing a bunch of typos

* hotfix netcdf version for dockerfiles

* Updated version number in setup.py to reflect new release, 2025.01.00

---------

Co-authored-by: Oliver Elbert <[email protected]>
Co-authored-by: Florian Deconinck <[email protected]>
Co-authored-by: Florian Deconinck <[email protected]>
Co-authored-by: Oliver Elbert <[email protected]>
Co-authored-by: Roman Cattaneo <>
Co-authored-by: Christopher Kung <[email protected]>
Co-authored-by: Roman Cattaneo <[email protected]>
Co-authored-by: Roman Cattaneo <[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.

3 participants