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 +1 -1
- risk/annotations/annotations.py +8 -9
- {risk_network-0.0.7b8.dist-info → risk_network-0.0.7b9.dist-info}/METADATA +1 -1
- {risk_network-0.0.7b8.dist-info → risk_network-0.0.7b9.dist-info}/RECORD +7 -7
- {risk_network-0.0.7b8.dist-info → risk_network-0.0.7b9.dist-info}/LICENSE +0 -0
- {risk_network-0.0.7b8.dist-info → risk_network-0.0.7b9.dist-info}/WHEEL +0 -0
- {risk_network-0.0.7b8.dist-info → risk_network-0.0.7b9.dist-info}/top_level.txt +0 -0
risk/__init__.py
CHANGED
risk/annotations/annotations.py
CHANGED
@@ -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
|
-
#
|
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
|
-
#
|
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
|
-
) #
|
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
|
267
|
-
if not words
|
268
|
-
|
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
|
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,8 +1,8 @@
|
|
1
|
-
risk/__init__.py,sha256=
|
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=
|
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.
|
27
|
-
risk_network-0.0.
|
28
|
-
risk_network-0.0.
|
29
|
-
risk_network-0.0.
|
30
|
-
risk_network-0.0.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|