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

Better handling of only flag #254

Open
lewisjared opened this issue Jul 2, 2019 · 3 comments
Open

Better handling of only flag #254

lewisjared opened this issue Jul 2, 2019 · 3 comments

Comments

@lewisjared
Copy link
Collaborator

MAGICC7 has a mechanism to specify a list of variables to write to file with the out_dynamic_vars parameter allowing for very fast runs if only a few variables are required.

Currently the only parameter in the call to run limits the files which are read from disk. For MAGICC7, this functionality can be extended to automatically write the out_dynamic_vars parameter, minimising the number of output files written.

Subannual files shouldn't be returned when using run. Instead users can read these files manually from the output dir if these files are needed.

@znicholls
Copy link
Collaborator

znicholls commented Jul 2, 2019

@lewisjared are you happy with these steps and what are your thoughts on subannual reading options?

  1. refactor MAGICC6 and MAGICCBase to make room for this change
  2. make MAGICCBase handling of only compatible with out_dynamic_vars and ignore all SUBANNUAL files when returning timeseries from run
  3. add convenience method to read subannual output (see question below)
  4. add example of this functionality to the MAGICC7 notebook

I think there's a couple of ways to do the subannual reading:

  1. add convenience method, read_output_file(self, filename) which takes a filename and reads it out of self.out_dir, raising an error if it can't find it
  2. add convenience method, read_subannual_output_files which reads any subannual files in self.out_dir
  3. add a read_subannual_output flag to the run method, if it's True, read subannual files preferentially

I'd go for read_subannual_output_files as read_output_file means you have to remember all the filenames (which is annoying) while read_subannual_output flag means you need to keep track of whether you're overwriting annual data or not (which is also annoying and is most likely a user choice anyway)

@lewisjared
Copy link
Collaborator Author

The problem is that these subannual files are so rarely used that if you need them you know what you need. A more generic method would be preferable as it provides convenience for much more use cases

@znicholls
Copy link
Collaborator

A more generic method would be preferable as it provides convenience for much more use cases

I'll take that to mean option 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants