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

Quantity factory to use dsl Float type as default #44

Merged
merged 12 commits into from
Jun 3, 2024

Conversation

fmalatino
Copy link
Contributor

@fmalatino fmalatino commented May 16, 2024

Description
Changes to QuantityFactory methods that previosuly defaulted to numpy.float64 type to use Float dsl type to enable specification of 32-bit or 64-bit precision.

How Has This Been Tested?
Tested using currently implemented unit tests
Use in builds of pyFV3, pySHiELD, and pace

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

@fmalatino fmalatino changed the title Changing float type to Float dsl type to add mixed precision functionality Quantity factory to use dsl Float type as default May 20, 2024
@fmalatino fmalatino force-pushed the fix/float_precision branch from 32dc434 to b87f813 Compare May 20, 2024 19:25
@fmalatino fmalatino marked this pull request as ready for review May 22, 2024 18:59
bensonr
bensonr previously approved these changes May 24, 2024
Copy link
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change, then good to go

ndsl/quantity.py Outdated
@@ -298,7 +300,7 @@ def __init__(
"""
# ToDo: [Florian 01/23] Kill the abomination.
# See https://github.com/NOAA-GFDL/pace/issues/3
from ndsl.dsl.typing import Float
# from ndsl.dsl.typing import Float
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather delete this instead of commenting it out

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check that all build are fine with removing the workaround and then, indeed, remove all comments.

Copy link
Contributor Author

@fmalatino fmalatino May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested these changes in the following ways:

  • Test branch in pyFV3 (develop)
    • python=3.8
      • translate numpy passes
      • translate dace:cpu passes
    • python=3.11
      • translate numpy passes
      • translate dace:cpu passes
  • Test branch in pySHiELD (develop)
    • python=3.8
      • translate numpy passes
      • translate dace:cpu passes
    • python=3.11
      • translate numpy passes
      • translate dace:cpu passes
  • Test branch in pace (develop)
    • python=3.8
      • tests/main passed
    • python=3.11
      • tests/main passed

xyuan
xyuan previously approved these changes May 25, 2024
ndsl/quantity.py Outdated
@@ -298,7 +300,7 @@ def __init__(
"""
# ToDo: [Florian 01/23] Kill the abomination.
# See https://github.com/NOAA-GFDL/pace/issues/3
from ndsl.dsl.typing import Float
# from ndsl.dsl.typing import Float
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check that all build are fine with removing the workaround and then, indeed, remove all comments.

@fmalatino fmalatino dismissed stale reviews from xyuan and bensonr via 2aef448 May 30, 2024 20:55
ndsl/quantity.py Outdated
@@ -298,7 +300,6 @@ def __init__(
"""
# ToDo: [Florian 01/23] Kill the abomination.
# See https://github.com/NOAA-GFDL/pace/issues/3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this before merging

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up the outdated comment and it's good for me!

Copy link
Collaborator

@oelbert oelbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fmalatino fmalatino merged commit c3afec1 into NOAA-GFDL:develop Jun 3, 2024
3 checks passed
@fmalatino fmalatino deleted the fix/float_precision branch June 18, 2024 17:22
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.

6 participants