GithubHelp home page GithubHelp logo

Comments (3)

bdestombe avatar bdestombe commented on July 28, 2024

Currently, I have in my modelscripts the following code. It works, is not pretty and not intuitively implented by the end-user.

if cnc.stress_period_data.data is None:
    gwt.remove_package(cnc.name[0])

from nlmod.

dbrakenhoff avatar dbrakenhoff commented on July 28, 2024

Checking for zero length stress_period_data makes sense to me. The least we should do is log a warning, but I think it also makes sense to prevent the package from being added/created in that situation.

from nlmod.

bdestombe avatar bdestombe commented on July 28, 2024

Thus using the example of the initiation of the CNC package:

    cnc = nlmod.gwt.cnc(
        ds,
        gwt,
        da_mask=(ds["northsea"] == 1).expand_dims({"layer": [ds.layer.data[0]]}),
        da_conc=ds["chloride"].isel(layer=slice(0, 1)),
    )

this code produce a zero-length stress_period_data because idomain, stored in ds, is false for all relevant cells.

Running this line of code should:

  • Not raise an error
  • Add a warning to the log that the package will not be added to the simulation because there is no stress_period_data
  • Do not add the package to gwt
  • Return None

from nlmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.