mpbn 4.0__py3-none-any.whl → 4.2__py3-none-any.whl

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.

Potentially problematic release.


This version of mpbn might be problematic. Click here for more details.

@@ -58,9 +58,9 @@ def ba_to_bdd(ba: boolean.BooleanAlgebra, f: boolean.Expression, ctx: BddVariabl
58
58
  # Check that all variables that exist in `f` also exist in `ctx`.
59
59
  assert all((ctx.find_variable(var) is not None) for var in variables)
60
60
  def ba_to_bdd_rec(f: boolean.Expression) -> Bdd:
61
- if type(f) is ba.TRUE or isinstance(f, minibn._TRUE):
61
+ if type(f) is ba.TRUE or isinstance(f, boolean._TRUE):
62
62
  return ctx.mk_const(True)
63
- if type(f) is ba.FALSE or isinstance(f, minibn._FALSE):
63
+ if type(f) is ba.FALSE or isinstance(f, boolean._FALSE):
64
64
  return ctx.mk_const(False)
65
65
  if type(f) is ba.Symbol:
66
66
  return ctx.mk_literal(str(f.obj), True)
mpbn/simulation.py CHANGED
@@ -188,7 +188,7 @@ def sample_reachable_attractor(f, mem, x, A, depth, W, refresh_rate=10, emit=Non
188
188
  I = set(f)
189
189
  n = len(f)
190
190
  def filter_reachable_attractors(A, x):
191
- H = spread(f, x, I, n)
191
+ H = spread(f, x, I, n)
192
192
  return [(ia,a) for (ia,a) in A if is_subhypercube(a, (x,H))]
193
193
  k = 1
194
194
  x = x.copy()
@@ -201,7 +201,7 @@ def sample_reachable_attractor(f, mem, x, A, depth, W, refresh_rate=10, emit=Non
201
201
  if k % refresh_rate == 0:
202
202
  A = filter_reachable_attractors(A, x)
203
203
  k += 1
204
- return A[0][0]
204
+ return None if (len(A)==0) else A[0][0]
205
205
 
206
206
  def sample_trace(f, mem, x, A, depth, W):
207
207
  if not isinstance(f, MPBNSim): f = MPBNSim(f)
@@ -257,6 +257,8 @@ def estimate_reachable_attractors_probabilities(f, x, A, nb_sims, depth, W):
257
257
  C = {ia: 0 for (ia,_) in A}
258
258
  for _ in tqdm(range(nb_sims)):
259
259
  ia = sample_reachable_attractor(f, mem, x, A, depth, W)
260
+ if (ia is None):
261
+ continue
260
262
  C[ia] += 1
261
263
  for ia, _ in A:
262
264
  C[ia] = (C[ia]*100) / nb_sims
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: mpbn
3
- Version: 4.0
3
+ Version: 4.2
4
4
  Summary: Simple implementation of Most Permissive Boolean networks
5
5
  Home-page: https://github.com/bnediction/mpbn
6
6
  Author: Loïc Paulevé
@@ -1,13 +1,13 @@
1
1
  mpbn/__init__.py,sha256=kbHB9JR5z2XP3FNaf2F06X9TaJM3PVVHzAsltT0_awg,22903
2
2
  mpbn/converters.py,sha256=6uCjxaJ2MI19_I1h0Pk9YN6PcDx42_C-Ml8ZRMA9uxg,416
3
- mpbn/simulation.py,sha256=3lk6yu7k2POrSytmtnsGIh596B-qcAgBtl16iZ0vzM4,10594
3
+ mpbn/simulation.py,sha256=DBtJbj1wyarHIbDcxLIuyWRNt2PRbiTjZxwB97cCAvE,10663
4
4
  mpbn/asplib/eval_circuit.asp,sha256=5rIbkVmvobaQwE_gHr0_USccPuI0QUPuzfw_1011hSE,989
5
5
  mpbn/asplib/eval_mixed.asp,sha256=n23pbjtxuWSCerL36Gb6O32bx8_1ukc52l1hQMMs8OE,787
6
6
  mpbn/asplib/mp_attractor.asp,sha256=CawLNxlYBZG2cl8XQAxA6EXEZ89Y9iw20CZ73n97Nu8,185
7
7
  mpbn/asplib/mp_eval.asp,sha256=PNa1APcKS9bgtCB3BtAdxq0mkg3p_x3G6fWSF3uAgzw,769
8
8
  mpbn/asplib/mp_positivereach-np.asp,sha256=SxLzZMszZxy_J14WTO7Me4aXldzxhqnL-ihqcnHCb8I,453
9
9
  mpbn/boolfunclib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- mpbn/boolfunclib/aeon_impl.py,sha256=X41J1tIeKIHomOpL9zrTzYaW12dkE79t_Wp9VXrP7XA,7660
10
+ mpbn/boolfunclib/aeon_impl.py,sha256=PpHx9dWa7wncctkQzgIgxy3Q6TQkhsiYR5hUnzACsAM,7662
11
11
  mpbn/boolfunclib/pyeda_impl.py,sha256=NkgE46MKrSOVInAF5W0QnTbAjVMtLM8ox05oJUMtPHo,5003
12
12
  mpbn/cli/__init__.py,sha256=v5C9U2YLR-J02JV-ciZkZoCvEcx7emgEy402mv4CdAg,2124
13
13
  mpbn/cli/sim.py,sha256=CHsbE4qp1L0iXyGLL1_zPontFjHL58qlt1_QVSWna68,6086
@@ -18,8 +18,8 @@ tests/test_fixpoints.py,sha256=bdDttzimiby48nVkVL-HXZ2rBldICBRbIZrVVbTGfso,786
18
18
  tests/test_input.py,sha256=mwMKd5UwAIY4Z1uZjYr09Ue8DLxD52CiPSoE-iXytfo,337
19
19
  tests/test_reachability.py,sha256=X7anTwFSIYcV2rltJBOW8TcAJnrt3SjYLqttB0eIL_Q,588
20
20
  tests/test_reachable_attractors.py,sha256=h78kvgmx9rTJWi3r2DZe_abYDxr02MLJ2iLDJUdLESY,540
21
- mpbn-4.0.dist-info/METADATA,sha256=DJlh3LPEMO30F7gkqQMPlfCfBrrSuQBmG-1ty-Chlew,2364
22
- mpbn-4.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
23
- mpbn-4.0.dist-info/entry_points.txt,sha256=CpzAc9SkB-mH_dojzt1N3YgDxy8hniDrIGzSHcPDo8g,68
24
- mpbn-4.0.dist-info/top_level.txt,sha256=oe3jlFHbQ6oIXyE1q7yAAnf1m49oP_jBPUU05d71n74,11
25
- mpbn-4.0.dist-info/RECORD,,
21
+ mpbn-4.2.dist-info/METADATA,sha256=BmmvG9KnkobRLLLw6x8V5tNJe2fAg1mJg6yzc18kg64,2364
22
+ mpbn-4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ mpbn-4.2.dist-info/entry_points.txt,sha256=CpzAc9SkB-mH_dojzt1N3YgDxy8hniDrIGzSHcPDo8g,68
24
+ mpbn-4.2.dist-info/top_level.txt,sha256=oe3jlFHbQ6oIXyE1q7yAAnf1m49oP_jBPUU05d71n74,11
25
+ mpbn-4.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
File without changes