Closed galengorski closed 1 year ago
When I am importing LSTMDA_torch.py
, I have to replace this:
from LSTMDA_torch import LSTMDA, fit_torch_model, rmse_masked
with:
import importlib
LSTMDA = importlib.import_module('03b_model.src.LSTMDA_torch', 'LSTMDA')
fit_torch_model = importlib.import_module('03b_model.src.LSTMDA_torch', 'fit_torch_model')
rmse_masked = importlib.import_module('03b_model.src.LSTMDA_torch', 'rmse_masked')
This is because I am working out of the root directory \USGS-R\\drb-estuary-salinity-ml
any time I'm running code. Are you only running this code in Snakemake? And is it working for you there?
I would have made a in-code suggestion, but I can't comment on that line since it wasn't in the diff for this particular pull request, so hopefully this comment in the main conversation thread is ok.
What was your process for importing river_dl.preproc_utils
? Did you just clone the repo adjacent to drb-estuary-salinity-ml
? Or do we want a stable copy of this file: https://github.com/USGS-R/river-dl/blob/main/river_dl/preproc_utils.py in our repo somewhere, in case they make changes?
When I am importing
LSTMDA_torch.py
, I have to replace this:from LSTMDA_torch import LSTMDA, fit_torch_model, rmse_masked
with:
import importlib LSTMDA = importlib.import_module('03b_model.src.LSTMDA_torch', 'LSTMDA') fit_torch_model = importlib.import_module('03b_model.src.LSTMDA_torch', 'fit_torch_model') rmse_masked = importlib.import_module('03b_model.src.LSTMDA_torch', 'rmse_masked')
This is because I am working out of the root directory
\USGS-R\\drb-estuary-salinity-ml
any time I'm running code. Are you only running this code in Snakemake? And is it working for you there?I would have made a in-code suggestion, but I can't comment on that line since it wasn't in the diff for this particular pull request, so hopefully this comment in the main conversation thread is ok.
I am running it through snakemake, maybe it will require a sys.path.append
to point the python path to the right directory
What was your process for importing
river_dl.preproc_utils
? Did you just clone the repo adjacent todrb-estuary-salinity-ml
? Or do we want a stable copy of this file: https://github.com/USGS-R/river-dl/blob/main/river_dl/preproc_utils.py in our repo somewhere, in case they make changes?
I used git submodule init
to initialize river-dl as a submodule in 03b_model/src/
, it might be nice to have a stable copy in there, ahtough right now we are just using a few pre processing functions
What was your process for importing
river_dl.preproc_utils
? Did you just clone the repo adjacent todrb-estuary-salinity-ml
? Or do we want a stable copy of this file: https://github.com/USGS-R/river-dl/blob/main/river_dl/preproc_utils.py in our repo somewhere, in case they make changes?I used
git submodule init
to initialize river-dl as a submodule in03b_model/src/
, it might be nice to have a stable copy in there, ahtough right now we are just using a few pre processing functions
I'd like to add this step into the Snakefile if possible so it's totally reproducible - I haven't used git submodules before - did you run "git submodule add https://github.com/USGS-R/river-dl"? And which directory were you in when you ran it?
This pull request contains 3 files: