SCECcode/bbp

FAS module no longer works as a standalone module (without comparing to observations)

Opened this issue · 3 comments

@fabiolsilva, I had been using the FAS module to compute FAS for simulations where I was not comparing with any observations. This commit to the FAS module now breaks it if observations aren't supplied:

646b247

I get this stack trace at first:

Traceback (most recent call last):
  File "/project/scec_608/kmilner/bbp/dev/bbp/comps/run_bbp.py", line 304, in <module>
    obj = item.instantiate(sim_id)
  File "/project/scec_608/kmilner/bbp/dev/bbp/comps/module.py", line 134, in instantiate
    return globals()[self.module_name](*self.module_args, **self.kw_args)
TypeError: __init__() missing 1 required positional argument: 'i_comparison_label'

I then tried changing the init method to default i_comparison_label to None, but get a new one:

Traceback (most recent call last):
  File "/project/scec_608/kmilner/bbp/dev/bbp/comps/run_bbp.py", line 305, in <module>
    obj.run()
  File "/project/scec_608/kmilner/bbp/dev/bbp/comps/fas.py", line 836, in run
    obs_dt = read_bbp_dt(input_obs_acc_file)
  File "/project/scec_608/kmilner/bbp/dev/bbp/comps/fas.py", line 339, in read_bbp_dt
    input_file = open(bbp_file)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/SLURM_3430421/tmpdata/11127002307386261/obs_seis_USC/USC.bbp'

I need this working soon, so I'll start throwing a bunch of if statements in there to isolate the observation code, but thought I would give you the chance to do it if you would prefer and can get to it in the next day or so. Thanks!

Kevin

@kevinmilner How do you call the FAS module? I think we will need a lot of if statements in order to make the run method work without observations. I'm inclined to have a separate run method that just does simulations. Would that work for you? Perhaps if i_comparison_label is None we can switch to the new run method.

Fabio

Thanks @fabiolsilva, that should work quite well! I call it on the command line via run_bby.py with an XML input file.

Commit e98d10b modified the FAS module to enable it to work with scenario simulations.