-
Notifications
You must be signed in to change notification settings - Fork 6
[FL-729] [FLPY-7] Dimensioned Output #1012
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
base: expressions
Are you sure you want to change the base?
Conversation
Some non-implementation changes, need to rebase again
9903bcc
to
87f90e9
Compare
output_fields: UniqueItemList[Union[VolumeFieldNames, str]] = pd.Field( | ||
# TODO: Not all SolverVariables can be used here. | ||
# TODO: `Expression` and `SolverVariable` still need business logic for validation (Surface Field/Expression?) | ||
output_fields: UniqueItemList[Union[VolumeFieldNames, str, ValueOrExpression]] = pd.Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ValueOrExpression is meant to be used as a generic type (e.g. ValueOrExpression[LengthType.Vector]
etc..) it might be better to just use Expression
here (I think its functionally identical?)... As I understand pure values here (like 4 * u.m / u.s
) make no sense here, so the field type might be slightly misleading.
if isinstance(field, str): | ||
udf_expression = generate_predefined_udf(field, input_params) | ||
if udf_expression: | ||
generated_udfs.append(UserDefinedField(name=field, expression=udf_expression)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This UserDefinedField
type looks very similar to what a UserVariable
is - do you think we could leverage this or is there some extra business logic that we need to take care of? Maybe we could inherit?
@@ -57,34 +57,3 @@ def is_instance_of_type_in_union(obj, typ) -> bool: | |||
|
|||
# Otherwise, do a normal isinstance check. | |||
return isinstance(obj, typ) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for removing that. I forgot about it.
Previous implementation: #992