risk-network 0.0.7b8__py3-none-any.whl → 0.0.7b9__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
@@ -7,4 +7,4 @@ RISK: RISK Infers Spatial Kinships
7
7
 
8
8
  from risk.risk import RISK
9
9
 
10
- __version__ = "0.0.7-beta.8"
10
+ __version__ = "0.0.7-beta.9"
@@ -177,19 +177,18 @@ def get_description(words_column: pd.Series) -> str:
177
177
  all_words = words_column.str.cat(sep=" ")
178
178
  tokens = word_tokenize(all_words)
179
179
 
180
- # Check if all tokens are numeric strings or contain a mixture of strings and numbers
180
+ # Separate numeric tokens
181
181
  numeric_tokens = [token for token in tokens if token.replace(".", "", 1).isdigit()]
182
- non_numeric_tokens = [token for token in tokens if not token.replace(".", "", 1).isdigit()]
183
182
  # If there's only one unique numeric value, return it directly as a string
184
183
  unique_numeric_values = set(numeric_tokens)
185
184
  if len(unique_numeric_values) == 1:
186
185
  return f"{list(unique_numeric_values)[0]}"
187
186
 
188
- # Allow the inclusion of both alphabetic and numeric tokens if mixture is detected
187
+ # Ensure that all values in 'words' are strings and include both alphabetic and numeric tokens
189
188
  words = [
190
- (
189
+ str(
191
190
  word.lower() if word.istitle() else word
192
- ) # Lowercase all words except proper nouns (e.g., RNA, mRNA)
191
+ ) # Convert to string and lowercase all words except proper nouns (e.g., RNA, mRNA)
193
192
  for word in tokens
194
193
  if word.isalpha()
195
194
  or word.replace(".", "", 1).isdigit() # Keep alphabetic words and numeric strings
@@ -263,11 +262,11 @@ def _generate_coherent_description(words: List[str]) -> str:
263
262
  Returns:
264
263
  str: A coherent description formed by arranging the words in a logical sequence.
265
264
  """
266
- # If there are no words or the input is invalid, raise an error
267
- if not words or not isinstance(words, list) or not all(isinstance(word, str) for word in words):
268
- raise ValueError("Input must be a list of strings.")
265
+ # If there are no words, return a keyword indicating no data is available
266
+ if not words:
267
+ return "N/A"
269
268
 
270
- # If there's only one unique word, return it directly (even if it's a number-like string)
269
+ # If there's only one unique word, return it directly
271
270
  unique_words = set(words)
272
271
  if len(unique_words) == 1:
273
272
  return list(unique_words)[0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: risk-network
3
- Version: 0.0.7b8
3
+ Version: 0.0.7b9
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,8 +1,8 @@
1
- risk/__init__.py,sha256=kEtmAgswqdIS5KBKHJO1NZkxJRF6s4ww_cjSOrBuJ4A,112
1
+ risk/__init__.py,sha256=Pj1ulqySghRcgi9kiMTvpjr7Mw5dg4vtjEdAkyImDFU,112
2
2
  risk/constants.py,sha256=XInRaH78Slnw_sWgAsBFbUHkyA0h0jL0DKGuQNbOvjM,550
3
3
  risk/risk.py,sha256=6666BzdMTgOaQl98ZKiJ19c6XBot26eTJ0iIlk-ZCZQ,20515
4
4
  risk/annotations/__init__.py,sha256=vUpVvMRE5if01Ic8QY6M2Ae3EFGJHdugEe9PdEkAW4Y,138
5
- risk/annotations/annotations.py,sha256=k9LGTL2uqdYvI5F3jU3UKz-O855B-DoazGPMzSn-XUc,11673
5
+ risk/annotations/annotations.py,sha256=3FFyJE9Gp5oRN72_8iVAUnecsmTtx2G2fp5AlCY1oUk,11405
6
6
  risk/annotations/io.py,sha256=lo7NKqOVkeeBp58JBxWJHtA0xjL5Yoxqe9Ox0daKlZk,9457
7
7
  risk/log/__init__.py,sha256=xuLImfxFlKpnVhzi_gDYlr2_c9cLkrw2c_3iEsXb1as,107
8
8
  risk/log/console.py,sha256=im9DRExwf6wHlcn9fewoDcKIpo3vPcorZIaNAl-0csY,355
@@ -23,8 +23,8 @@ risk/stats/stats.py,sha256=kvShov-94W6ffgDUTb522vB9hDJQSyTsYif_UIaFfSM,7059
23
23
  risk/stats/permutation/__init__.py,sha256=neJp7FENC-zg_CGOXqv-iIvz1r5XUKI9Ruxhmq7kDOI,105
24
24
  risk/stats/permutation/permutation.py,sha256=kmSZ7bQ-AD0TFiQDgIwfxTeqHa4pjp7fIcOzAqyhUNY,9714
25
25
  risk/stats/permutation/test_functions.py,sha256=HuDIM-V1jkkfE1rlaIqrWWBSKZt3dQ1f-YEDjWpnLSE,2343
26
- risk_network-0.0.7b8.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
27
- risk_network-0.0.7b8.dist-info/METADATA,sha256=aFjqRdtk2rsHn0AHuofhj9ZtkFFuuxfgLd_DnyX52qA,43142
28
- risk_network-0.0.7b8.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
29
- risk_network-0.0.7b8.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
30
- risk_network-0.0.7b8.dist-info/RECORD,,
26
+ risk_network-0.0.7b9.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
27
+ risk_network-0.0.7b9.dist-info/METADATA,sha256=SMrU7EhdEUAHteWWFDPCCQ5PxRjcAOoNfGlOKMpp-w4,43142
28
+ risk_network-0.0.7b9.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
29
+ risk_network-0.0.7b9.dist-info/top_level.txt,sha256=NX7C2PFKTvC1JhVKv14DFlFAIFnKc6Lpsu1ZfxvQwVw,5
30
+ risk_network-0.0.7b9.dist-info/RECORD,,