-
Notifications
You must be signed in to change notification settings - Fork 0
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
auto-generated calculator functions stubs #25
Conversation
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.
I think you need one more argument to the generated functions: For example:
def area(self, source_parts: Union[List['ENS_PART'], List[int], List[str]], result_type: str = 'Compute_Per_case') -> 'ENS_VAR':
will always generate (or replace) the variable named 'Area'. IMHO, the name of the output variable (e.g. 'my_area') and the plist should be required parameters.
v = something.area("my_var", s.ensight.objs.core.PARTS)
should create a variable named "my_var" in EnSight, not always named "Area".
@randallfrank I like the idea of passing the variable name as a parameter, but I believe it would be better to make it optional. What I have done is to build an incremental name if you don't pass the variable name. Let's say you are computing the area If you don't pass the argument "output_varname", it will be called Area_0, Area_1 and so on depending on how many times you call it. Otherwise it will use the passed value |
…d an incremental name
…ositional arguments to None instead of -1 if default not available
Wiz Scan Summary
|
Add more docstrings to the various variable methods.
Co-authored-by: Randy Frank <[email protected]>
The idea is to just import this under the variables utils and make an instance of the auto-generated class a property:
e.g.
session.ensight.utils.variables.calculator.area()