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

Fix unit converter problem with units = 1 #459

Closed
wants to merge 4 commits into from

Conversation

gold2718
Copy link
Collaborator

Fix unit converter problem with units = 1

In order for the unit converter to be able to attempt a unit conversion where one variable has units = 1, a special case has been added where the digit, 1, is converted to the string one (a valid Python identifier).

User interface changes?: No

Fixes: #458, Unit converter does not handle a variable with units = 1

Testing:
unit tests: run with a new test added to test this functionality.
system tests: NA
manual testing: NA

Steve Goldhaber added 4 commits July 13, 2022 21:45
Allow schema file to be passed to validate
Add Fortran comment write method
Add metadata table type and name to CCPP datatable variable entries
Improve generated constituent-handling code
Fix issues with output of long comments
Ensure more instance variables are 'private'
Have capgen create database object
Add line fill (target line length) interface to FortranWriter
New Fortran interface, indent_size
New Fortran interface, blank_line
Added insert function for verbatim copy to file
Allow arbitrary break for long lines
Make sure call list variables have an intent
Added link to constituent dictionary
Add metadata to CCPP constituent object DDT
Add Fortran writing unit tests and fix line break bugs
Added constituent props array host interface, improved unit conversion error
Use +ELLIPSIS instead of +IGNORE_EXCEPTION_DETAILS for doctests
Constituent cleanup, no function side effects in interface
Completed and optimized constituent accessor routines
Added minimum allowed value property
@gold2718 gold2718 requested a review from climbfuji as a code owner December 22, 2022 17:31
@gold2718
Copy link
Collaborator Author

Note that I did no add any conversion between 1 and any other unit (including None) but at least now you get the intended error from the unit converter.

@gold2718
Copy link
Collaborator Author

Since I am no longer a member of the NCAR domain, I lost all my access to this repo so I cannot perform any maintenance such as assign myself to an issue or PR.

@climbfuji
Copy link
Collaborator

Since I am no longer a member of the NCAR domain, I lost all my access to this repo so I cannot perform any maintenance such as assign myself to an issue or PR.

I was already wondering what happened ... now you are admin again.

@climbfuji
Copy link
Collaborator

Is this PR supposed to go into feature/capgen? I see 49 changed files, but was expecting only one file changing to fix the unit converter.

@climbfuji
Copy link
Collaborator

Thanks by the way for fixing the problem!

@gold2718
Copy link
Collaborator Author

I think I should close this and open it from a cleaner branch.
The other changes are related to constitutents work. Sound good?

@gold2718
Copy link
Collaborator Author

Closing to reopen from cleaner branch.

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.

2 participants