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

POEM 050 - make the use of val/value in the API consistent #109

Merged
merged 5 commits into from
Jun 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions POEM_050.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
POEM ID: 050
Title: Fix val/value inconsistency in the API
authors: [robfalck]
Competing POEMs: N/A
Related POEMs: N/A
Associated implementation PR:

Status:

- [ ] Active
- [ ] Requesting decision
- [ ] Accepted
- [ ] Rejected
- [x] Integrated


Motivation
----------

Multiple users have noted that OpenMDAO is a bit inconsistent in its API wrt the use of the terms `val` and `value` when providing values of variables.
This POEM aims to resolve this inconsistency.

Description
-----------

OpenMDAO uses the keyword `val` to specify that values are being provided in most places.
Notable exceptions are metadata for I/O which uses `value`, and (ironically) `set_val`, which uses the keyword argument `value`.

Use of `value` will still function, with deprecation warnings, until version 4.0.0, which is expected to be released in the summer of 2021.
At that point, all metadata references and keyword argument names which were previously `value` must be replaced with `val`.

Examples
--------

`list_inputs` and `list_outputs` will change from `values=True` to `val=True`. `values` will still be available but it will be deprecated.

```
prob.model.list_inputs(val=True)
prob.model.list_outputs(val=True)
```

`set_val` will also deprecate `value` in favor of `val`. Set `val` to your values to avoid deprecation warnings.

```
def set_val(self, name, value=None, units=None, indices=None, val=None):
```


Backwards Compatibility
------------------------

This change will be backwards incompatible.
Deprecations will be put in place such that `value` will work as it currently does until the OpenMDAO 4.0.0 release.