You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current API assumes that the custom constraint class is defined a Python file, and then imported/created in a different Python file. I would like the option to create a class and use it in the same file
This also makes demoing & internally testing a custom constraint a lot easier.
Expected behavior
In the new SDV 1.0 API, the workflow is changing a bit. When loading a constraint class from a different file, we will offer this function:
When you want to do it from the same file, you will have the object. We should add a new function to add it.
synthesizer.add_custom_constraint_class(
class_object=MyCustomConstraint,
class_name='MyCustomConstraint'# the name to use when referring to the constraint
)
Then you can create constraints using the defined class_name:
npatki
changed the title
Allow me to create a Custom Constraint Class and use it in the same file (filepath=None)
Allow me to create a custom constraint class and use it in the same file
Jan 31, 2023
Problem Description
The current API assumes that the custom constraint class is defined a Python file, and then imported/created in a different Python file. I would like the option to create a class and use it in the same file
This also makes demoing & internally testing a custom constraint a lot easier.
Expected behavior
In the new SDV 1.0 API, the workflow is changing a bit. When loading a constraint class from a different file, we will offer this function:
When you want to do it from the same file, you will have the object. We should add a new function to add it.
Then you can create constraints using the defined
class_name
:The text was updated successfully, but these errors were encountered: