mpbn 4.1__tar.gz → 4.2__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.

Potentially problematic release.


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

@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: mpbn
3
- Version: 4.1
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é
@@ -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.1
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é
@@ -4,7 +4,7 @@
4
4
  from setuptools import setup, find_packages
5
5
 
6
6
  NAME = "mpbn"
7
- VERSION = "4.1"
7
+ VERSION = "4.2"
8
8
 
9
9
  setup(name=NAME,
10
10
  version=VERSION,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes