Open Lvulis opened 2 years ago
The config worked fine for me, creating a single job with the specified parameters.
pyDeltaRCM_20220518-143617.log
Can you confirm you are passing the yaml file to the high-level API? Either from the terminal as $ pyDeltaRCM --config issue.yaml
or to the Preprocessor
as pyDeltaRCM.Preprocessor('issue.yaml')
? You can't use the any of the expansion behavior (matrix
, ensemble
, or set
) with the low-level api as pyDeltaRCM.DeltaModel('issue.yaml')
.
We are using the low level processor, so using .DeltaModel
. Could be worth updating the docs, skimmed them and didn't see it specifying needing to use the high level API for the expansion behavior.
Example code:
#import necessary packages
import pyDeltaRCM
import time
#set delta model... parameters are set from the configuration .YAML file, which can be adjusted for different case scenarios
default_delta = pyDeltaRCM.DeltaModel(input_file='WLD-configuration.yaml')
#model start time
t1 = time.time()
#model timestep as a forloop
for _ in range(0, 5):
default_delta.update()
default_delta.finalize()
#model end time
t2 = time.time()
#total model runtime
tfinal = t2- t1
print ('Total model runtime =', tfinal)
cool yeah, that is not supported, but I agree I jsut looked at the docs, and I agree it's totally not clear that you can't do that.
I'll leave this open until I can update the docs. Thanks for pointing this out!!
Going to re-open this issue as I got the below warning when using the high-level API and specifying timesteps
in my YAML:
UserWarning: One or more inputs in yaml file or kwargs were unused by the model during instantiation. The unused keys are: ['timesteps']
warnings.warn(UserWarning(
Understandably this is from the if-else clause in init_tools.py
. An easy solve might be to add an elif
statement there to skip the acceptable high-level API parameters (timesteps, time, time_years, If, dryrun, and parallel), or modify the set of acceptable keywords at the start of that block of logic.
Hm, can you confirm you're on the latest version / the development version? I thought I fixed this by not writing the time variables out to the job yamls here. Can you write a test to reproduce the warning?
actually #259 that I never finished was supposed to add the parallel
kw, so we could add these others you've suggested there, and then need tests to make sure it's working :eyes:
We've been using set notation but find that the model is not recognizing these. This may be an edge case as this is an unnecessary scenario where only 1 set of alternatives is provided, not multiple.
The input yaml:
The resulting log file: