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

334 monsoon wang charles review [WIP] #489

Merged
merged 44 commits into from
Jan 20, 2018

Conversation

doutriaux1
Copy link
Contributor

do not merge yet

else:
ext = ""
# We need to make sure there is no "dot" in filename or import will fail
if fnm.find(".") > -1:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zshaheen shouldn't your class already take care of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@doutriaux1 Yes, the parser already does this.

highlights = parameters.highlights


print '-----------------------------'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zshaheen does your Parser has a verbosity argument? If so we should use it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@doutriaux1 No, there's no verbosity arg. I'll add that into my fix for today.

from SeabarChart_mpl import BarChart
import argparse
from argparse import RawTextHelpFormatter
import pdb #, pdb.set_trace()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should probably take it out in production




# -- Exploring a way to handle an auxillary json file
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gleckler1 shouldn't we use the JSON class here?

@@ -0,0 +1 @@
from monsoon_precip_index_fncs import *
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@doutriaux1 note to self edit this to import only what's needed.

import MV2
# SEASONAL RANGE - USING ANNUAL CYCLE CLIMATOLGIES 0=Jan, 11=Dec
def mpd(d):
mjjas = (d[4] + d[5] + d[6] + d[7] + d[8])/5.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

soo.... we're 100% certain the deal with climo files from Jan to Dec here, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

All clim statistics in the PMP driver expect this too.

return annrange, mpi

def mpi_skill_scores(annrange_mod_dom,annrange_obs_dom,thr):
mt = MV2.where(MV2.greater(annrange_mod_dom,thr),1.,0.)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mt = MV2.greater(annrange_mod_dom,thr).astype("i") does the same faster

hit = float(MV2.sum(hitmap))

mt1 = MV2.where(MV2.greater(annrange_mod_dom,thr),10.,0.)
both1 = MV2.add(mt1,ot) # 10 for MOD above THRESHOLD, OTHERWISE 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not both1 = mt1 + ot ???

mt = MV2.where(MV2.greater(annrange_mod_dom,thr),1.,0.)
ot = MV2.where(MV2.greater(annrange_obs_dom,thr),1.,0.)

both = MV2.add(mt,ot) # HIT WILL MEAN 2, OTHERWISE 0 or 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not just + ???

Copy link
Contributor

Choose a reason for hiding this comment

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

@doutriaux1 I thought it was better practice to use MV than + - / *

@doutriaux1
Copy link
Contributor Author

@gleckler1 c an you send me an example on how to run this? Thx!

@gleckler1
Copy link
Contributor

@doutriaux1
Copy link
Contributor Author

thx @gleckler1

default = 'rms',
help = "Statistic:\n"
"- Available options: bias, cor, rms")
P.add_argument("-seas", "--season",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one dash should only be ONE letter, multiple letters with two dashes

@doutriaux1
Copy link
Contributor Author

not ready at all!!!

@doutriaux1
Copy link
Contributor Author

@gleckler1 this branch computation part is ready for you to give it a test drive

Things I need to do:

  • Add a test case
  • Make code use genutil.StringConstructors
  • Cleanup graphics code
  • Port graphics to VCS (very long term)

Things you need to do:

  • Make sure this branch produces correct result
  • Cleanup arguments so that they are consistent accross drivers (at least with pcmdi_metrics_driver)

@gleckler1
Copy link
Contributor

Outstanding CD ... may the world improve for you (and the rest of us)!

@gleckler1
Copy link
Contributor

@cd Is GH pull of 334_monsoon_wang_charles_review they way for me to install this and test it out?

@doutriaux1
Copy link
Contributor Author

doutriaux1 commented Jun 8, 2017

yep, please pull and checkout this branch then

python setup.py install --enable-devel

Then

mpi_compute.py -h

@gleckler1
Copy link
Contributor

@doutriaux1 Followed instructions but something not right. I expected refactored code to be in:
https://github.com/PCMDI/pcmdi_metrics/tree/334_monsoon_wang_charles_review/src/python**/devel**/monsoon_wang

not

https://github.com/PCMDI/pcmdi_metrics/tree/334_monsoon_wang_charles_review/src/python/monsoon_wang

This probably explains why:
bash-4.1$ python setup.py install --enable-devel
demo files
Adding experimental packages
running install
running build
running build_py
copying src/python/pcmdi/std_xy.py -> build/lib/pcmdi_metrics/pcmdi
copying src/python/pcmdi/mean_climate_metrics_calculations.py -> build/lib/pcmdi_metrics/pcmdi
copying src/python/init.py -> build/lib/pcmdi_metrics
.
.
.
error: package directory 'src/python/devel/monsoon_wang/lib' does not exist

@doutriaux1
Copy link
Contributor Author

@gleckler1 yes i moved it into the main it's not in devel anymore since it's for merging in master. I had left stuff in devel because I think it was the graphics. I'll clean it so that --devel works again.

@gleckler1
Copy link
Contributor

@doutriaux1 OKBYME. I presume I should still do a test run before we merge. To do that, should I use python setup.py install
instead of python setup.py install --enable-devel ?

@gleckler1 gleckler1 merged commit dddf781 into master Jan 20, 2018
@gleckler1 gleckler1 deleted the 334_monsoon_wang_charles_review branch March 31, 2021 19:30
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