pacificclimate / climate-explorer-backend

4 stars 1 forks source link

Files without runs? #109

Open rod-glover opened 4 years ago

rod-glover commented 4 years ago

In adding tests for the streamflow/watershed API, I discovered that if a file does not have a run associated with it, then the models API endpoint fails. The key code is this:

{dfv.file.run.model.short_name for dfv in ensemble.data_file_variables}

where ensemble is a pycds.Ensemble object.

Overlooking the fact that there are likely alternative queries more robust to absent links between ensemble and model, there's the question of whether we already do or plan to allow for files without runs. I am not sure how we resolved this question, so this issue may just be a placeholder for retrieving a previous decision that resolves this problem while I continue working on the watershed API.

corviday commented 4 years ago

I think in the past we've specified the "run" for files that are not model output as either "na" or "base", but we've given them runs.

rod-glover commented 4 years ago

Thank you, @corviday , working when you are supposed to be resting!

jameshiebert commented 4 years ago

Yeah, I'd argue that we should only be querying files that are linked to the runs table (and that non-model output should at least have something). If you both agree, then this could make a good-first-issue.