Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop invalid components being added to model #431

Merged
merged 2 commits into from Apr 24, 2019
Commits on Apr 12, 2019
  1. Fix invalid component handling

    alubbock committed Apr 12, 2019
    Previously, if one added an invalid parameter, rule etc. that generated
    an exception in `__init__`, (e.g. a validation error), the component
    was still added to the model. In interactive mode, this is annoying, as
    the model has to be re-instantiated. Example:
    
        Model()
        Parameter('a', 'invalid_value')  # raises ValueError
        assert len(model.parameters) == 0  # fixed in this PR
        Parameter('a', 1.0)  # should succeed
    
    This PR fixes this situation by adding the Component to the Model
    (by calling `Component.__init__()`) last instead of first.
Commits on Apr 24, 2019
  1. Merge branch 'master' into fix_invalid_components

    alubbock committed Apr 24, 2019
You can’t perform that action at this time.