risk-network 0.0.3b2__py3-none-any.whl → 0.0.3b4__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.
risk/__init__.py CHANGED
@@ -10,4 +10,4 @@ RISK: RISK Infers Spatial Kinship
10
10
 
11
11
  from risk.risk import RISK
12
12
 
13
- __version__ = "0.0.3-beta.2"
13
+ __version__ = "0.0.3-beta.4"
risk/log/params.py CHANGED
@@ -147,14 +147,11 @@ class Params:
147
147
  params = self.load()
148
148
  # Open the file in write mode
149
149
  with open(filepath, "w") as txt_file:
150
- for key, nested_dict in params.items():
151
- # Write the key
152
- txt_file.write(f"{key}:\n")
153
- # Write the nested dictionary values, one per line
154
- for nested_key, nested_value in nested_dict.items():
155
- txt_file.write(f" {nested_key}: {nested_value}\n")
156
- # Add a blank line between different keys
157
- txt_file.write("\n")
150
+ for key, value in params.items():
151
+ # Write the key and its corresponding value
152
+ txt_file.write(f"{key}: {value}\n")
153
+ # Add a blank line after each entry
154
+ txt_file.write("\n")
158
155
 
159
156
  def load(self) -> Dict[str, Any]:
160
157
  """Load and process various parameters, converting any np.ndarray values to lists.
risk/stats/stats.py CHANGED
@@ -153,9 +153,11 @@ def _run_permutation_test(
153
153
  results = pool.starmap_async(_permutation_process_subset, params_list)
154
154
 
155
155
  # Update progress bar based on progress_counter
156
+ # NOTE: Waiting for results to be ready while updating progress bar gives a big improvement
157
+ # in performance, especially for large number of permutations and workers
156
158
  while not results.ready():
157
159
  progress.update(progress_counter.value - progress.n)
158
- results.wait(0.1)
160
+ results.wait(1) # Wait for 1 second
159
161
 
160
162
  # Ensure progress bar reaches 100%
161
163
  progress.update(total_progress - progress.n)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.3b2
3
+ Version: 0.0.3b4
4
4
  Summary: A Python package for biological network analysis
5
5
  Author: Ira Horecka
6
6
  Author-email: Ira Horecka <ira89@icloud.com>
@@ -1,4 +1,4 @@
1
- risk/__init__.py,sha256=H7Oal2XxdwvgwfVdxjsgEpAPdyruGRh2shgYLfJXFCs,122
1
+ risk/__init__.py,sha256=7JTz-sr7kIgP1-2x6p8-HirKCr90zZTsy-gIbKdeYMw,122
2
2
  risk/constants.py,sha256=AICk3x5qRQhls_ijTb4VdbdxU6mZ1aLGbAjLEdBwfJI,550
3
3
  risk/risk.py,sha256=cWpYogZ-vma4ZZjewVNRMzb2TqHv8YABuzP2brXpOqo,16399
4
4
  risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
@@ -6,7 +6,7 @@ risk/annotations/annotations.py,sha256=gZ9gihK_eTWaX3eByh08xr97FX4-XKe6MBwCCjasE
6
6
  risk/annotations/io.py,sha256=ozi7aFn3_geB6G0kt7Ya1qVhNOqP6rB0YISjriSZyNw,7989
7
7
  risk/log/__init__.py,sha256=xuLImfxFlKpnVhzi_gDYlr2_c9cLkrw2c_3iEsXb1as,107
8
8
  risk/log/console.py,sha256=im9DRExwf6wHlcn9fewoDcKIpo3vPcorZIaNAl-0csY,355
9
- risk/log/params.py,sha256=VI52p9zlHptm-m05QBO1cBVZKn6rZA_QKBgDuZQhXY0,6494
9
+ risk/log/params.py,sha256=Tbb-sovFTptGBqPDKafUA8KOpby4zFObutAT_Iti1hE,6302
10
10
  risk/neighborhoods/__init__.py,sha256=tKKEg4lsbqFukpgYlUGxU_v_9FOqK7V0uvM9T2QzoL0,206
11
11
  risk/neighborhoods/community.py,sha256=eL2IGT-8sbiJIyfyb_FGngev7pEMxw7tZb8YzbzOYw8,6512
12
12
  risk/neighborhoods/domains.py,sha256=HwuChmZH0RGD9eQOvk2-ezQDJRUHHn93vhVgHb-kX6I,10192
@@ -18,9 +18,9 @@ risk/network/io.py,sha256=KmdrsDZe-ZT4O59NYZM_nQd8Ew9qpbzQcqWS_PaE7eA,12559
18
18
  risk/network/plot.py,sha256=fy21X677xqJPFkn564Jegxy05C9x0pJXovd5fm3NZ4Q,34554
19
19
  risk/stats/__init__.py,sha256=4s9gdJo5B1G_cQc0iMoeIBt5OrQNXkdtNXkAMFQkLxc,103
20
20
  risk/stats/permutation.py,sha256=xgaZbaxo57t_FzPlpcb2nsq8oCzc_wj-zAm-xj3P2dA,3404
21
- risk/stats/stats.py,sha256=_3Fj5H8Nml4cExvLg7Mt_i1HCLAJJcJSDiiSzr3uFlo,15798
22
- risk_network-0.0.3b2.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
23
- risk_network-0.0.3b2.dist-info/METADATA,sha256=y75hZFuUFJ99JoFX2koM3Xf_aI28MKXxiFKHV8iV4yw,43256
24
- risk_network-0.0.3b2.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
25
- risk_network-0.0.3b2.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
26
- risk_network-0.0.3b2.dist-info/RECORD,,
21
+ risk/stats/stats.py,sha256=Yu9LMSUtCRkg-h0ErJurb-rkajHgTvdzBcymHldJs5k,16007
22
+ risk_network-0.0.3b4.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
23
+ risk_network-0.0.3b4.dist-info/METADATA,sha256=_xhdIlmS0XAYJWRI1yjQppksLevhfTX_wFjKzX5hf9Q,43256
24
+ risk_network-0.0.3b4.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
25
+ risk_network-0.0.3b4.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
26
+ risk_network-0.0.3b4.dist-info/RECORD,,