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

Direct Parameters #145

Merged
merged 4 commits into from
Jul 5, 2024
Merged

Direct Parameters #145

merged 4 commits into from
Jul 5, 2024

Conversation

teubert
Copy link
Contributor

@teubert teubert commented Jul 5, 2024

Add support to set parameters directly using square brackets in the model so that

m.parameters['abc'] = 1

becomes

m['abc'] = 1

Also updated the examples to take advantage of this feature.

.parameters syntax will still work as expected (and be slightly faster), but this provides a cleaner syntax for parameters.

@teubert teubert self-assigned this Jul 5, 2024
@teubert teubert requested a review from kjjarvis July 5, 2024 21:18
@teubert teubert added components: models enhancement New feature or request labels Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

Thank you for opening this PR. Each PR into dev requires a code review. For the code review, look at the following:

  • Reviewer (someone other than author) should look for bugs, efficiency, readability, testing, and coverage in examples (if relevant).
  • Ensure that each PR adding a new feature should include a test verifying that feature.
  • All errors from static analysis must be resolved.
  • Review the test coverage reports (if there is a change) - will be added as comment on PR if there is a change
  • Review the software benchmarking results (if there is a change) - will be added as comment on PR
  • Any added dependencies are included in requirements.txt, setup.py, and dev_guide.rst (this document)
  • All warnings from static analysis must be reviewed and resolved - if deemed appropriate.

Copy link
Contributor

@kjjarvis kjjarvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to direct access to parameters looks good

@teubert teubert merged commit d2b1e00 into dev Jul 5, 2024
29 of 30 checks passed
@teubert teubert deleted the feature/direct_param branch July 5, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
components: models enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants