Creating a custom subclass and using the preprocessor is complicated. Mostly, because creating the netcdf file has to be delayed until the job is assigned to a different thread (connection to netcdf is not pickle-able).
So, when you get the error
Existing NetCDF4 output file in target output location: /.../job_000/pyDeltaRCM_output.nc
which is raised from here but actually called during the run command for the parallel job, and delivered to the user here on error, it can be pretty confusing.
I was tripped up because I forgot to pass **kwargs input to the subclass model, on to __init__ for the DeltaModel.
Two ways to help this:
- improve the documentation: emphaize the importance of passing the kwargs in any subclass
- raise a helpful warning about
defer_output=True during creating parallel jobs, and so emphasizing again "Are you sure you passed **kwargs to DeltaModel instantiation in your subclass?"
Creating a custom subclass and using the preprocessor is complicated. Mostly, because creating the netcdf file has to be delayed until the job is assigned to a different thread (connection to netcdf is not pickle-able).
So, when you get the error
which is raised from here but actually called during the
runcommand for the parallel job, and delivered to the user here on error, it can be pretty confusing.I was tripped up because I forgot to pass
**kwargsinput to the subclass model, on to__init__for theDeltaModel.Two ways to help this:
defer_output=Trueduring creating parallel jobs, and so emphasizing again "Are you sure you passed **kwargs toDeltaModelinstantiation in your subclass?"