flamapy 2.0.0.dev0__tar.gz → 2.0.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flamapy
3
- Version: 2.0.0.dev0
3
+ Version: 2.0.0.dev2
4
4
  Summary: Flamapy feature model is a distribution of the flama framework containing all plugins required to analyze feature models. It also offers a richier API and a complete command line interface and documentation.
5
5
  Home-page: https://github.com/flamapy/flamapy-feature-model
6
6
  Author: Flamapy
@@ -4,17 +4,17 @@ from typing import Optional
4
4
 
5
5
  class FLAMAFeatureModel():
6
6
 
7
- def __init__(self, modelPath:str, configurationPath:Optional[str]=None):
7
+ def __init__(self, model_path:str, configuration_path:Optional[str]=None):
8
8
  """
9
9
  This is the path in the filesystem where the model is located.
10
10
  Any model in UVL, FaMaXML or FeatureIDE format are accepted
11
11
  """
12
- self.modelPath=modelPath
12
+ self.model_path=model_path
13
13
  """
14
14
  This is the path in the filesystem where the configuration is located.
15
15
  Only CSV format are accepted (see documentation for more information)
16
16
  """
17
- self.modelPath=configurationPath
17
+ self.configuration_path=configuration_path
18
18
  """
19
19
  Creating the interface witht he flama framework
20
20
  """
@@ -22,19 +22,25 @@ class FLAMAFeatureModel():
22
22
  """
23
23
  We save the model for later ussage
24
24
  """
25
- self.fm_model=self._read(modelPath)
25
+ self.fm_model=self._read(model_path)
26
26
  """
27
- We create a empty sat model to avoid double transformations
27
+ We create a empty sat model and a bdd model to avoid double transformations
28
28
  """
29
29
  self.sat_model=None
30
-
31
- def _read(self, modelPath)->FeatureModel:
32
- return self.dm.use_transformation_t2m(modelPath,'fm')
30
+ self.bdd_model=None
31
+
32
+
33
+ def _read(self, model_path)->FeatureModel:
34
+ return self.dm.use_transformation_t2m(model_path,'fm')
33
35
 
34
36
  def _transform_to_sat(self):
35
- if self.sat_model == None:
37
+ if self.sat_model is None:
36
38
  self.sat_model=self.dm.use_transformation_m2m(self.fm_model,"pysat")
37
-
39
+
40
+ def _transform_to_bdd(self):
41
+ if self.bdd_model is None:
42
+ self.bdd_model=self.dm.use_transformation_m2m(self.fm_model,"bdd")
43
+
38
44
  def atomic_sets(self):
39
45
  """
40
46
  This operation is used to find the atomic sets in a model:
@@ -207,26 +213,6 @@ class FLAMAFeatureModel():
207
213
  return None
208
214
 
209
215
 
210
- def error_detection(self):
211
- """
212
- This refers to the process of identifying and locating errors in a feature model.
213
- Errors can include things like dead features, false optional features, or
214
- contradictions in the constraints.
215
- """
216
- try:
217
- self._transform_to_sat()
218
- #errors = self.dm.use_operation(self.sat_model,'Glucose3ErrorDetection').get_result()
219
-
220
- operation = self.dm.get_operation(self.sat_model,'PySATErrorDetection')
221
- operation.feature_model=self.fm_model
222
- operation.execute(self.sat_model)
223
- result = operation.get_result()
224
- return result
225
- except Exception as e:
226
- print(f"Error: {e}")
227
- return None
228
-
229
-
230
216
  def false_optional_features(self):
231
217
  """
232
218
  These are features that appear to be optional in the feature model, but due to the
@@ -265,30 +251,41 @@ class FLAMAFeatureModel():
265
251
  return None
266
252
 
267
253
 
268
- def configurations_number(self):
254
+ def configurations_number(self, with_sat:bool=False):
269
255
  """
270
256
  This is the total number of different full configurations that can be produced from a feature model.
271
257
  It's calculated by considering all possible combinations of features, taking into account
272
258
  the constraints and dependencies between features.
273
259
  """
274
260
  try:
275
- self._transform_to_sat()
276
- nop = self.dm.use_operation(self.sat_model,'PySATConfigurationsNumber').get_result()
261
+ nop=0
262
+ if with_sat:
263
+ self._transform_to_sat()
264
+ nop = self.dm.use_operation(self.sat_model,'PySATConfigurationsNumber').get_result()
265
+
266
+ else:
267
+ self._transform_to_bdd()
268
+ nop = self.dm.use_operation(self.bdd_model,'BDDConfigurationsNumber').get_result()
277
269
  return nop
278
270
  except Exception as e:
279
271
  print(f"Error: {e}")
280
272
  return None
281
273
 
282
274
 
283
- def configurations(self):
275
+ def configurations(self, with_sat:bool=False):
284
276
  """
285
277
  These are the individual outcomes that can be produced from a feature model. Each product
286
278
  is a combination of features that satisfies all the constraints and dependencies in the
287
279
  feature model.
288
280
  """
289
281
  try:
290
- self._transform_to_sat()
291
- products = self.dm.use_operation(self.sat_model,'PySATConfigurations').get_result()
282
+ products=[]
283
+ if with_sat:
284
+ self._transform_to_sat()
285
+ products = self.dm.use_operation(self.sat_model,'PySATConfigurations').get_result()
286
+ else:
287
+ self._transform_to_bdd()
288
+ products = self.dm.use_operation(self.bdd_model,'BDDConfigurations').get_result()
292
289
  return products
293
290
  except Exception as e:
294
291
  print(f"Error: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flamapy
3
- Version: 2.0.0.dev0
3
+ Version: 2.0.0.dev2
4
4
  Summary: Flamapy feature model is a distribution of the flama framework containing all plugins required to analyze feature models. It also offers a richier API and a complete command line interface and documentation.
5
5
  Home-page: https://github.com/flamapy/flamapy-feature-model
6
6
  Author: Flamapy
@@ -0,0 +1,12 @@
1
+ wheel
2
+ flamapy-fw==2.0.0.dev2
3
+ flamapy-fm==2.0.0.dev2
4
+ flamapy-sat==2.0.0.dev2
5
+ flamapy-bdd==2.0.0.dev1
6
+
7
+ [dev]
8
+ pytest
9
+ pytest-mock
10
+ prospector
11
+ mypy
12
+ coverage
@@ -4,10 +4,19 @@ import setuptools
4
4
  with open("README.md", "r") as fh:
5
5
  long_description = fh.read()
6
6
 
7
+ def read_requirements(file):
8
+ with open(file, "r") as fh:
9
+ return fh.read().splitlines()
10
+
11
+ # Read requirements from the requirements.txt file
12
+ requirements = read_requirements("requirements.txt")
13
+
14
+ # Read development requirements from the dev-requirements.txt file
15
+ dev_requirements = read_requirements("requirements-dev.txt")
7
16
 
8
17
  setuptools.setup(
9
18
  name="flamapy",
10
- version="2.0.0.dev0",
19
+ version="2.0.0.dev2",
11
20
  author="Flamapy",
12
21
  author_email="flamapy@us.es",
13
22
  description="Flamapy feature model is a distribution of the flama framework containing all plugins required to analyze feature models. It also offers a richier API and a complete command line interface and documentation.",
@@ -21,20 +30,9 @@ setuptools.setup(
21
30
  "Operating System :: OS Independent",
22
31
  ],
23
32
  python_requires='>=3.9',
24
- install_requires=[
25
- "wheel",
26
- "flamapy-fw~=2.0.0.dev0",
27
- "flamapy-fm~=2.0.0.dev0",
28
- "flamapy-sat~=2.0.0.dev0",
29
- ],
33
+ install_requires=requirements,
30
34
  extras_require={
31
- 'dev': [
32
- 'pytest',
33
- 'pytest-mock',
34
- 'prospector',
35
- 'mypy',
36
- 'coverage',
37
- ]
35
+ 'dev': dev_requirements
38
36
  },
39
37
  entry_points={
40
38
  'console_scripts': [
@@ -1,11 +0,0 @@
1
- wheel
2
- flamapy-fw~=2.0.0.dev0
3
- flamapy-fm~=2.0.0.dev0
4
- flamapy-sat~=2.0.0.dev0
5
-
6
- [dev]
7
- pytest
8
- pytest-mock
9
- prospector
10
- mypy
11
- coverage
File without changes
File without changes