Adding support for CS output derivatives - #416
Open
PeterMeisrimelModelon wants to merge 1 commit into
Open
Conversation
PeterMeisrimelModelon
force-pushed
the
dev-pm-480
branch
2 times, most recently
from
August 11, 2026 07:27
65bb534 to
aee97c1
Compare
PeterMeisrimelModelon
force-pushed
the
dev-pm-481
branch
from
August 11, 2026 14:27
be4a773 to
e131b96
Compare
PeterMeisrimelModelon
force-pushed
the
dev-pm-481
branch
from
August 11, 2026 14:40
e131b96 to
820b086
Compare
efredriksson-modelon
requested changes
Aug 12, 2026
efredriksson-modelon
left a comment
Collaborator
There was a problem hiding this comment.
Looks good 🍎, some suggestions for making the implementation easier to read.
| value_refs = np.array([0], dtype=np.uint32, ndmin=1).ravel() | ||
| orders = np.array([order], dtype=np.int32) | ||
| value_refs[0] = self.get_variable_valueref(variables) | ||
| elif isinstance(variables, list) and np.prod([int(isinstance(v, str)) for v in variables]): #prod equals 0 or 1 |
Collaborator
There was a problem hiding this comment.
Could we not just use all(isinstance(v, str)) for v in variables) here?
Comment on lines
+4001
to
+4004
| if isinstance(variables, str): | ||
| nref = 1 | ||
| value_refs = np.array([0], dtype=np.uint32, ndmin=1).ravel() | ||
| orders = np.array([order], dtype=np.int32) |
Collaborator
There was a problem hiding this comment.
To have less repetition we can use:
if isinstance(variables, str):
variables = [variables]
to have this case transform to the general
Comment on lines
+4013
to
+4014
| else: | ||
| raise FMUException("The variables must either be a string or a list of strings") |
Collaborator
There was a problem hiding this comment.
Consider having the error check first for an early return to have less cognitive load/indentation when reading the actual implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are no real tests, since none of the reference FMUs actually support this.