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
As a user, it would be helpful to treat my custom constraints similarly to normal constraint classes, while also having a clear way to distinguish them.
Acceptance criteria
Change the name of create_custom_constraint to create_custom_constraint_class
Add a method called load_custom_constraint_classes
Parameters
filepath: Path to file where custom constraints are defined
class_names: The names of the constraint classes to import from that file
The method should import the constraint class objects from that file as the name provided in the class_names list
Error:
Ensure that the constraint_name isn't already defined in the module Error: The constraint 'MyConstraintClass' already exists. Please choose a different 'constraint_name'.
Currently, the create_custom_constraints requires the constraint_name to contain the name that would be used to import (ie. foler.file.class_name). We want users to be able to refer to the name of the class directly, so we want to use the load_custom_constraint_classes method to add the class to the namespace so it can be imported later by just the class name
The text was updated successfully, but these errors were encountered:
Problem Description
As a user, it would be helpful to treat my custom constraints similarly to normal constraint classes, while also having a clear way to distinguish them.
Acceptance criteria
create_custom_constraint
tocreate_custom_constraint_class
load_custom_constraint_classes
filepath
: Path to file where custom constraints are definedclass_names
: The names of the constraint classes to import from that fileclass_names
listError: The constraint 'MyConstraintClass' already exists. Please choose a different 'constraint_name'.
Expected behavior
In one file, create the constraint classes
In your script
Additional context
Currently, the
create_custom_constraints
requires theconstraint_name
to contain the name that would be used to import (ie.foler.file.class_name
). We want users to be able to refer to the name of the class directly, so we want to use theload_custom_constraint_classes
method to add the class to the namespace so it can be imported later by just the class nameThe text was updated successfully, but these errors were encountered: