Add equals (__eq__) and hash code (__hash__) and to string (__str__) methods for all classes (Feature, Relation, Constraint, and FeatureModel).
Note: __eq__ and __hash__ of constraints should be replaced by comparing the AST object, but actually the AST doesn't allow comparison. __str__ needs also to be defined for constraints based on the AST. Maybe can be reused from __str__ of FeatureModel class.
In FeatureModel, now the list of features and relations are correctly initialized and cached. This should need double check by other developer!!!
Integrate utils methods within the Feature class:
is_mandatory, is_optional, is_or_group, is_alternative_group, and is_group.
Refactor constraint keyword by constraints in FeatureModel constructor __init__.
At this moment, this does not affect any other class of the FM_METAMODEL nor PYSAT_METAMODEL plugins.
New operations:
All operations in FM_METAMODEL follow the convention of implementing the operation in an independent function instead of a method of the class to improve usability of the operations.
Some of the following operations have not interface defined (they could be defined is needed).
New operations are:
(1) Core features
(2) Leaf features
(3) Feature ancestors
(4) Max depth tree
A question arise for those operations that need additional arguments (e.g., the FeatureAncestor operation). How the arguments are provided? Maybe in the constructor __init__ as it is now defined?
Refactor implementation of FMCountLeafs operation for a more Pythonic implementation.
Fixed implementation of FMAverageBranchingFactor operation to solve the calculation error reported in issue #21.
Other minor changes:
Refactor transformation name of afm_transformatin.py by afm_transformation.py.
At this moment, I think this has no colateral effects.
CHANGES:
Add equals (
__eq__
) and hash code (__hash__
) and to string (__str__
) methods for all classes (Feature, Relation, Constraint, and FeatureModel).Note:
__eq__
and__hash__
of constraints should be replaced by comparing the AST object, but actually the AST doesn't allow comparison.__str__
needs also to be defined for constraints based on the AST. Maybe can be reused from__str__
of FeatureModel class.In FeatureModel, now the list of features and relations are correctly initialized and cached. This should need double check by other developer!!!
Integrate utils methods within the Feature class:
is_mandatory
,is_optional
,is_or_group
,is_alternative_group
, andis_group
.Long lines break before binary operators instead of after the operator, following the recommendation in PEP8 by Donald KNuth for more readable code (Ref.: https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator)
Refactor
constraint
keyword byconstraints
in FeatureModel constructor__init__
. At this moment, this does not affect any other class of the FM_METAMODEL nor PYSAT_METAMODEL plugins.New operations: All operations in FM_METAMODEL follow the convention of implementing the operation in an independent function instead of a method of the class to improve usability of the operations. Some of the following operations have not interface defined (they could be defined is needed). New operations are: (1) Core features (2) Leaf features (3) Feature ancestors (4) Max depth tree A question arise for those operations that need additional arguments (e.g., the FeatureAncestor operation). How the arguments are provided? Maybe in the constructor
__init__
as it is now defined?Refactor implementation of FMCountLeafs operation for a more Pythonic implementation.
Fixed implementation of FMAverageBranchingFactor operation to solve the calculation error reported in issue #21.
Other minor changes:
afm_transformatin.py
byafm_transformation.py
. At this moment, I think this has no colateral effects.