Conversation
VeckoTheGecko
left a comment
There was a problem hiding this comment.
Just a small change so that we aren't comparing against a repr :)
src/virtualship/cli/_fetch.py
Outdated
|
|
||
| if "DRIFTER" in instruments_in_schedule: | ||
| print("Drifter data will be downloaded") | ||
| if "DRIFTER" in str(instruments_in_schedule): |
There was a problem hiding this comment.
Just wondering what the motivation for this is? Was it not working before?
Since instruments_in_schedule is a call to schedule.get_instruments() giving a set[InstrumentType], I think the right way to do this would be
| if "DRIFTER" in str(instruments_in_schedule): | |
| if InstrumentType.DRIFTER in instruments_in_schedule: |
(also making sure InstrumentType is imported at the top)
There was a problem hiding this comment.
Yes, much more sensible. I've made these changes. I've added the InstrumentType import within the _fetch function to avoid circular import errors. Does that seem sensible?
There was a problem hiding this comment.
Yes, that sounds good. I'm not sure why we're getting circular imports, might be worth me looking at the package structure.
But yes, a lot of code sometimes puts the import in the function body rather than the top of the file
* update init command to use CTD_BGC as new instrument when making schedule * update example ship_config file to also include CTD_BGC instrument config * Prevent fetch from downloading unnecessary data and skipping data download for certain instruments (#175) * fixes for over-extensive data downloads and skipping certain instruments * fixes based on PR feedback #175 * Managing conflicts on branch. Move InstrumentType to ship_config.py * Move Waypoint to schedule.py * update init command to use CTD_BGC as new instrument when making schedule * add configuration for CTD_BGC * add bgc data download option for CTD_BGC instrument * add CTD_BGC to instruments which prompts ship data download * Review feedback on complete_download --------- Co-authored-by: Vecko <36369090+VeckoTheGecko@users.noreply.github.com>
* update init command to use CTD_BGC as new instrument when making schedule * update example ship_config file to also include CTD_BGC instrument config * Prevent fetch from downloading unnecessary data and skipping data download for certain instruments (#175) * fixes for over-extensive data downloads and skipping certain instruments * fixes based on PR feedback #175 * Managing conflicts on branch. Move InstrumentType to ship_config.py * Move Waypoint to schedule.py * update init command to use CTD_BGC as new instrument when making schedule * add configuration for CTD_BGC * add bgc data download option for CTD_BGC instrument * add CTD_BGC to instruments which prompts ship data download * Review feedback on complete_download * bgc input data .nc files for testing * add CTD_BGC to static/example schedule (also necessary for ship_config test) * update test suite for new bgc sampling using ctd_bgc * new ctd_bgc instrument * add ctd_bgc sampling capability to virtualship run execution --------- Co-authored-by: Vecko <36369090+VeckoTheGecko@users.noreply.github.com>
Closes #174