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

636 pjg climmetricsbymonth #751

Merged
merged 10 commits into from
Aug 5, 2021
Merged

636 pjg climmetricsbymonth #751

merged 10 commits into from
Aug 5, 2021

Conversation

gleckler1
Copy link
Contributor

No description provided.

@gleckler1
Copy link
Contributor Author

@lee1043 @acordonez still getting errors after fixing flake8 issues. This is a simple change to the mean climate metrics to enable us to include climatological annual cycle precip (and other) results. Wondering if this represents another breakdown with cdms. Any thoughts???

@lee1043
Copy link
Contributor

lee1043 commented Jul 14, 2021

@gleckler1 I found following error log from circle ci which are about flake8. I don't think there is cdms breakdown here.

Click to show log messages

b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:256:40: E225 missing whitespace around operator'
b'        rmsc_mo_l.append(format(rmsc_mo* conv , sig_digits))'
b'                                       ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:256:46: E203 whitespace before ','"
b'        rmsc_mo_l.append(format(rmsc_mo* conv , sig_digits))'
b'                                             ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:258:45: E203 whitespace before ','"
b'        mae_mo_l.append(format(mae_mo * conv , sig_digits))'
b'                                            ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:260:50: E225 missing whitespace around operator'
b'        stdObs_xy_mo_l.append(format(stdObs_xy_mo* conv,sig_digits))'
b'                                                 ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:260:56: E231 missing whitespace after ','"
b'        stdObs_xy_mo_l.append(format(stdObs_xy_mo* conv,sig_digits))'
b'                                                       ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:261:44: E225 missing whitespace around operator'
b'        std_xy_mo_l.append(format(std_xy_mo* conv,sig_digits))'
b'                                           ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:261:50: E231 missing whitespace after ','"
b'        std_xy_mo_l.append(format(std_xy_mo* conv,sig_digits))'
b'                                                 ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:262:52: E225 missing whitespace around operator'
b'        meanObs_xy_mo_l.append(format(meanObs_xy_mo* conv , sig_digits))'
b'                                                   ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:262:58: E203 whitespace before ','"
b'        meanObs_xy_mo_l.append(format(meanObs_xy_mo* conv , sig_digits))'
b'                                                         ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:263:46: E225 missing whitespace around operator'
b'        mean_xy_mo_l.append(format(mean_xy_mo* conv , sig_digits))'
b'                                             ^'
b"/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:263:52: E203 whitespace before ','"
b'        mean_xy_mo_l.append(format(mean_xy_mo* conv , sig_digits))'
b'                                                   ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:276:62: W291 trailing whitespace'
b"    metrics_dictionary['rms_xy']['CalendarMonths'] = rms_mo_l"
b'                                                             ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:277:64: W291 trailing whitespace'
b"    metrics_dictionary['rmsc_xy']['CalendarMonths'] = rmsc_mo_l"
b'                                                               ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:279:53: E222 multiple spaces after operator'
b"    metrics_dictionary['mae_xy']['CalendarMonths'] =  mae_mo_l"
b'                                                    ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:279:63: W291 trailing whitespace'
b"    metrics_dictionary['mae_xy']['CalendarMonths'] =  mae_mo_l"
b'                                                              ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:280:72: W291 trailing whitespace'
b"    metrics_dictionary['std-obs_xy']['CalendarMonths'] = stdObs_xy_mo_l"
b'                                                                       ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:281:65: W291 trailing whitespace'
b"    metrics_dictionary['std_xy']['CalendarMonths'] = std_xy_mo_l"
b'                                                                ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:282:74: W291 trailing whitespace'
b"    metrics_dictionary['mean-obs_xy']['CalendarMonths'] = meanObs_xy_mo_l"
b'                                                                         ^'
b'/home/circleci/project/pcmdi_metrics/pcmdi/mean_climate_metrics_calculations.py:286:5: E303 too many blank lines (2)'
b'    return metrics_dictionary'
b'    ^'
b"4     E203 whitespace before ','"
b'1     E222 multiple spaces after operator'
b'5     E225 missing whitespace around operator'
b"2     E231 missing whitespace after ','"
b'1     E303 too many blank lines (2)'
b'6     W291 trailing whitespace'

@lee1043
Copy link
Contributor

lee1043 commented Jul 14, 2021

@gleckler1 I made fix for aforementioned flake8 issues.

@gleckler1
Copy link
Contributor Author

@lee1043 more flake8? I thought I got them all. Fingers crossed JL fixes do the trick. Thanks!

Copy link
Collaborator

@acordonez acordonez left a comment

Choose a reason for hiding this comment

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

I gave this a test with the demo data and looked at the result in the unified dashboard. Since the calendar month stats are in a sub-list, they can't be viewed with the other seasonal metrics.

Would something like this work instead? Or do these stats need to be in their own list?
"bias_xy": {
"ann": 1.163,
"djf": 1.727,
"mam": 1.408,
"jja": 0.848,
"son": 0.727,
"Jan": 1.768,
"Feb": 1.278,
"Mar": 1.297,
...
]

Edited to add: Since they are in a sub-list, the CMEC JSON conversion currently isn't able to catch these stats to convert them from strings to float in the CMEC compliant JSON.

@gleckler1
Copy link
Contributor Author

@acordonez @lee1043 AO that suggestion makes sense except these results are typically used as a 12-month time series (e.g., https://pcmdi.llnl.gov/pmp-preliminary-results/interactive_plot/precip/seasonal_cycle/pr_annual.cycle_all.loc.mod_interactive.html), so its convenient to read them in as a python list. Otherwise additional coding would be needed for reading in or visualizing. Also, I don't expect we would be using these monthly values on the dashboard. For that we'd likely stick with seasonal or annual means. But certainly open to compromises that work for both purposes if we can think of a solution.

@acordonez
Copy link
Collaborator

@gleckler1 @lee1043 That makes sense for needing the list. I added a couple lines to the base write_cmec class to also convert the list contents to floats in the CMEC formatted version - shall I push that to this branch?

@gleckler1
Copy link
Contributor Author

@acordonez @lee1043 AO I would hold off on making changes to the write_cmec class on this branch right now because this branch continues to fail CI for reasons we don't understand. Hopefully it is a silly PG mistake, not a problem with cdat on conda. PG is about to attempt a simple test (pull request with no real changes to master) to see if it passes or fails... finger crossed!

Copy link
Collaborator

@acordonez acordonez left a comment

Choose a reason for hiding this comment

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

Approving now that we've isolated the test failures.

@gleckler1
Copy link
Contributor Author

@acordonez @lee1043 Just checking for the last time, we've concluded its ok to merge this to master, right?

@lee1043
Copy link
Contributor

lee1043 commented Aug 5, 2021

@gleckler1 yes we did. I am merging it.

@lee1043 lee1043 merged commit cfab8a8 into master Aug 5, 2021
@lee1043 lee1043 deleted the 636_pjg_climmetricsbymonth branch August 5, 2021 19:29
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.

None yet

3 participants