Skip to content

Improve code for bounds in RBAnalysis._setup_fitting #103

@yaelbh

Description

@yaelbh

The current code consists of the following lines, related to bounds calculation:

        user_bounds = self._get_option("bounds")
        ...
        fit_option = {
            "p0": {
                 ...
            },
            "bounds": {
                "a": user_bounds["a"] or (0.0, 1.0),
                "alpha": user_bounds["alpha"] or (0.0, 1.0),
                "b": user_bounds["b"] or (0.0, 1.0),
            },
        }

The default values of the bounds have been previously entered in _default_options. So they don't need to be entered again here, and what's called user_bounds is in fact either user or default. In short, this could be shortened to

fit_option = {
            "p0": {
                 ...
            },
            "bounds": self._get_option("bounds")
        }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions