Skip to content

[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

Open
wants to merge 3 commits into
base: expressions
Choose a base branch
from

Conversation

benflexcompute
Copy link
Collaborator

Previous implementation: #992

Some non-implementation changes, need to rebase again
@benflexcompute benflexcompute force-pushed the BenY/FL-729-DimensionedOutput branch from 9903bcc to 87f90e9 Compare May 14, 2025 15:57
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(
Copy link
Contributor

@andrzej-krupka andrzej-krupka May 16, 2025

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))
Copy link
Contributor

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)

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants