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

Changed printing to use proper scientific notation #180

Merged
merged 7 commits into from
Feb 2, 2022

Conversation

ewu63
Copy link
Collaborator

@ewu63 ewu63 commented Jan 29, 2022

Purpose

I changed a lot of the printing that used the format e. to use es., so that numbers show up as 4.9E2 instead of 0.49E3. I was really annoyed with the constant leading zero, so this should make everything more readable.

I used some regex to find these, so I might've missed some stuff. Would appreciate some checking by ADflow maintainers since I'm not as familiar with the code. This may also be a good time to change other printing formats, especially since I noticed we are now showing 16 decimal places which is probably too much.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I ran the MACH-Aero tutorial and saw that the printing is now using proper scientific notation.

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@ewu63 ewu63 requested a review from a team as a code owner January 29, 2022 19:37
@ewu63 ewu63 requested review from anilyil and sseraj January 29, 2022 19:37
@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #180 (03c019e) into master (7ea4d01) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #180   +/-   ##
=======================================
  Coverage   43.10%   43.10%           
=======================================
  Files          15       15           
  Lines        3517     3517           
=======================================
  Hits         1516     1516           
  Misses       2001     2001           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ea4d01...03c019e. Read the comment docs.

@eirikurj
Copy link
Contributor

eirikurj commented Jan 31, 2022

@nwu63 I updated one more place that I was aware was missing. Think this is somewhat complete in terms of printout to the terminal.
Perhaps we should also consider updating how the slice/lift .dat files write to the files, as they also use the leading zero notation.

@ewu63
Copy link
Collaborator Author

ewu63 commented Jan 31, 2022

I agree, I've pushed up some more changes. Please take a look.

Copy link
Collaborator

@sseraj sseraj left a comment

Choose a reason for hiding this comment

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

I tried this out locally and it is a definite improvement. I actually like 16 digits being printed for the monitor variables, so I am fine with this as is. I also checked that the Tecplot output files still work with the new format.

@anilyil anilyil merged commit aefd207 into master Feb 2, 2022
@anilyil anilyil deleted the change-num-printing branch February 2, 2022 18:39
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.

4 participants