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

Vette Frame object #386

Merged
merged 23 commits into from Jun 7, 2017
Merged

Vette Frame object #386

merged 23 commits into from Jun 7, 2017

Conversation

profxj
Copy link
Contributor

@profxj profxj commented May 20, 2017

Code to vette the sanctity of a Frame object.
Currently only checks data shape and FLAVOR in meta

Also brings in the concept of parameter files into desispec.
I suspect @sbailey will suggest a modified architecture.

Deprecates the use of 'dark', 'bright', etc. for FLAVOR type.
All are captured by 'science'.

@gdhungana
Copy link
Contributor

Pinging @rstaten for test failure issue on XWSigma test.

@profxj
Copy link
Contributor Author

profxj commented Jun 3, 2017

Is it possible to make progress on this PR (i.e. the failing
XWSigma test)? I have additional code that builds on this
and I wish this PR to clear before doing the next PR.

@sbailey
Copy link
Contributor

sbailey commented Jun 6, 2017

Also brings in the concept of parameter files into desispec.
I suspect @sbailey will suggest a modified architecture.

Not to disappoint, I'll give a minor quibble: changes.rst calls this file data/params/desispec_param.yaml which I like better than the actual implemented name py/desispec/data/params/desi_obj.yml, even if it is hidden by the wrapper function desispec.io.read_obj_param(). I'm not sure what "obj" is supposed to mean in this context and future updates to the parameter file. Maybe just desispec.io.read_params()?

Provided that the tests now pass, please consider that renaming, then go ahead and merge.

For consideration: in similar functions in desimodel, the results of the file are cached so that future calls to the loader don't have to re-read from disk when asking for the same file. If we start fetching these parameters a lot we should do that to limit I/O.

@profxj
Copy link
Contributor Author

profxj commented Jun 6, 2017

Passing now. @sbailey , be sure to take a look at the
approach to parameters in desispec. Otherwise
may be ready to merge.

@profxj
Copy link
Contributor Author

profxj commented Jun 6, 2017

Added a test, made params a global (in desispec.io.params),
and renamed the bits and pieces.

@tskisner
Copy link
Member

tskisner commented Jun 6, 2017

Just a quick comment- if we have thousands of processes that all call "read_params" to load a tiny yaml file, then what happens? Can we be certain that read_params is not called during normal pipeline operations? I guess if we are running from a docker image maybe this matters less, but we should avoid touching the disk except when necessary during pipeline running. Obviously calling Frame.vette() is fine from a QA process running after a given pipeline step.

@profxj
Copy link
Contributor Author

profxj commented Jun 6, 2017

I think this is a very good point. If we are concerned about I/O then
we should consider coding the params file as a dict. But is loading
a module once per process that much slower than reading a file
from disk once. On the latter point, let me have this cache properly [hold a minute]

@rkehoe
Copy link
Contributor

rkehoe commented Jun 6, 2017

@profxj et al, If this is in relation to the params governing QAs, then it may be useful to keep in mind that the quicklook QAs take their params as dicts in a configuration file. We are substantially updating that right now, but there are already examples in the quicklook github for this. All of the params have been planned to be configurable. It would be very useful for offline and quicklook to use the same approach, again assuming this thread is referring to the reduction QA params.

@profxj
Copy link
Contributor Author

profxj commented Jun 6, 2017

It is not referring to QA (today), but we can conflate
it to do so. As such, see what is implemented here
and comment accordingly.

@profxj
Copy link
Contributor Author

profxj commented Jun 7, 2017

@rkehoe -- Please let me know if you are ok with this PR.
If so, I will ask Stephen to merge.

@rkehoe
Copy link
Contributor

rkehoe commented Jun 7, 2017

@profxj I do not think the QA params discussion should delay your PR, so please do your merge. We will be asking for a merge on the QuickLook PR very soon, and this will hopefully help a discussion of this topic.

@profxj
Copy link
Contributor Author

profxj commented Jun 7, 2017

Very good. @sbailey , merge if you are happy.

@sbailey
Copy link
Contributor

sbailey commented Jun 7, 2017

I fixed parameter caching; the previous implementation would have ignored the "filename" argument if the parameters had been previously read from a different filename. We may never have hit that situation, but as long as "filename" is an option we should have it fully working. I added tests for this case too.

I also fixed "vette" -> "vet" (past tense is "vetted", but present tense if "vet").

OK to merge when tests pass.

@profxj
Copy link
Contributor Author

profxj commented Jun 7, 2017

Merging.

@profxj profxj merged commit 838338e into master Jun 7, 2017
@profxj profxj deleted the vette_frame branch June 7, 2017 22:20
@profxj profxj mentioned this pull request Jun 8, 2017
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

5 participants