How to lazily add custom readers? #1230
brucelaughlin
started this conversation in
General
Replies: 1 comment
|
I believe you can do |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have modified the ROMS native reader to read some biological variables. I have ROMS data coming from multiple files in multiple directories, and I would like to add multiple lazy readers to my model, so that readers are only initialized when the simulation reaches a given time.
In the documentation, it says that "add_readers_from_list" or "add_readers_from_file" are lazy by default, but I can't find any documentation about how to make a custom reader lazy before adding it. I tried using "r.is_lazy = True" (which is a property I saw somewhere; can't find the file at this moment) before adding the reader "r", but my code seems to still be initializing all readers before beginning the simulation.
So, how can I make custom readers lazy, specifically a reader modeled after "reader_ROMS_native" ? Must it be done within the reader code itself, or can a property be modified before adding it?
I'll continue reading, including looking at the code of "reader_lazy.py" to see if I can further modify my own reader to make it work as a lazy reader.
Thanks!
All reactions