Skip to content

Add a helpful error message when subclassing and having netcdf conflict issues #240

@amoodie

Description

@amoodie

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?"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions