genome-entropy 0.1.1__tar.gz → 0.1.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.
- {genome_entropy-0.1.1/src/genome_entropy.egg-info → genome_entropy-0.1.2}/PKG-INFO +4 -3
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/README.md +3 -2
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/pyproject.toml +1 -1
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/estimate_tokens.py +24 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/encoder.py +1 -1
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/logging_config.py +5 -3
- {genome_entropy-0.1.1 → genome_entropy-0.1.2/src/genome_entropy.egg-info}/PKG-INFO +4 -3
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_cli_smoke.py +22 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_logging_config.py +0 -14
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/LICENSE +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/setup.cfg +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/download.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/encode3di.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/entropy.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/orf.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/run.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/translate.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/main.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/config.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/encoding.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/gpu_utils.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/multi_gpu.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/prostt5.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/token_estimator.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/types.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/entropy/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/entropy/shannon.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/errors.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/io/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/io/fasta.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/io/genbank.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/io/jsonio.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/orf/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/orf/finder.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/orf/types.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/pipeline/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/pipeline/runner.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/translate/__init__.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/translate/translator.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/SOURCES.txt +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/dependency_links.txt +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/entry_points.txt +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/requires.txt +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/top_level.txt +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_basic.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_encoder_methods.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_entropy.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_genbank.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_gpu_discovery.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_multi_gpu_encoding.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_orf_finder.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_prostt5_integration.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_token_budget_batches.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_token_estimator.py +0 -0
- {genome_entropy-0.1.1 → genome_entropy-0.1.2}/tests/test_translation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: genome_entropy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Quantify information content across multiple biological representations derived from genomic sequences
|
|
5
5
|
Author-email: Rob Edwards <raedwards@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -43,9 +43,10 @@ Dynamic: license-file
|
|
|
43
43
|
# genome_entropy
|
|
44
44
|
|
|
45
45
|
[](https://edwards.flinders.edu.au/)
|
|
46
|
-
|
|
46
|
+
[](https://doi.org/10.5281/zenodo.18312206)
|
|
47
47
|
[](https://github.com/linsalrob/genome_entropy/actions)
|
|
48
|
-
[](https://linsalrob.github.io/genome_entropy/)
|
|
49
|
+
[](https://orf-entropy.readthedocs.io/en/latest/?badge=latest)
|
|
49
50
|
[](https://www.python.org/downloads/)
|
|
50
51
|
[](https://opensource.org/licenses/MIT)
|
|
51
52
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# genome_entropy
|
|
2
2
|
|
|
3
3
|
[](https://edwards.flinders.edu.au/)
|
|
4
|
-
|
|
4
|
+
[](https://doi.org/10.5281/zenodo.18312206)
|
|
5
5
|
[](https://github.com/linsalrob/genome_entropy/actions)
|
|
6
|
-
[](https://linsalrob.github.io/genome_entropy/)
|
|
7
|
+
[](https://orf-entropy.readthedocs.io/en/latest/?badge=latest)
|
|
7
8
|
[](https://www.python.org/downloads/)
|
|
8
9
|
[](https://opensource.org/licenses/MIT)
|
|
9
10
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "genome_entropy"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Quantify information content across multiple biological representations derived from genomic sequences"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
{genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/cli/commands/estimate_tokens.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Token size estimation command."""
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
from typing import Optional
|
|
4
5
|
import traceback
|
|
5
6
|
|
|
@@ -51,6 +52,17 @@ def estimate_token_size_command(
|
|
|
51
52
|
"-b",
|
|
52
53
|
help="Approximate length of individual proteins (amino acids)",
|
|
53
54
|
),
|
|
55
|
+
log_level: str = typer.Option(
|
|
56
|
+
"INFO",
|
|
57
|
+
"--log-level",
|
|
58
|
+
"-l",
|
|
59
|
+
help="Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)",
|
|
60
|
+
),
|
|
61
|
+
log_file: Optional[Path] = typer.Option(
|
|
62
|
+
None,
|
|
63
|
+
"--log-file",
|
|
64
|
+
help="Path to log file (default: log to STDOUT)",
|
|
65
|
+
),
|
|
54
66
|
) -> None:
|
|
55
67
|
"""Estimate optimal token size for GPU encoding.
|
|
56
68
|
|
|
@@ -61,8 +73,20 @@ def estimate_token_size_command(
|
|
|
61
73
|
The recommended token size is returned as 90% of the maximum for safety.
|
|
62
74
|
"""
|
|
63
75
|
try:
|
|
76
|
+
from ...config import VALID_LOG_LEVELS
|
|
77
|
+
from ...logging_config import configure_logging
|
|
64
78
|
from ...encode3di import ProstT5ThreeDiEncoder, estimate_token_size
|
|
65
79
|
|
|
80
|
+
# Validate and configure logging
|
|
81
|
+
if log_level.upper() not in VALID_LOG_LEVELS:
|
|
82
|
+
typer.echo(
|
|
83
|
+
f"Error: Invalid log level '{log_level}'. Must be one of: {', '.join(VALID_LOG_LEVELS)}",
|
|
84
|
+
err=True,
|
|
85
|
+
)
|
|
86
|
+
raise typer.Exit(2)
|
|
87
|
+
|
|
88
|
+
configure_logging(level=log_level.upper(), log_file=log_file)
|
|
89
|
+
|
|
66
90
|
typer.echo("=" * 60)
|
|
67
91
|
typer.echo("Token Size Estimation")
|
|
68
92
|
typer.echo("=" * 60)
|
|
@@ -117,7 +117,7 @@ class ProstT5ThreeDiEncoder:
|
|
|
117
117
|
|
|
118
118
|
# only GPUs support half-precision currently; if you want to run on
|
|
119
119
|
# CPU use full-precision (not recommended, much slower)
|
|
120
|
-
_ = self.model.
|
|
120
|
+
_ = self.model.float() if self.device == "cpu" else self.model.half()
|
|
121
121
|
|
|
122
122
|
def token_budget_batches(
|
|
123
123
|
self,
|
|
@@ -48,12 +48,14 @@ def configure_logging(
|
|
|
48
48
|
global _configured, _log_file, _log_level
|
|
49
49
|
|
|
50
50
|
# Convert string level to int if needed
|
|
51
|
+
ori_level = level
|
|
51
52
|
if isinstance(level, str):
|
|
52
53
|
level = getattr(logging, level.upper(), logging.INFO)
|
|
53
54
|
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
# We always reconfigure, whether or not we are forced to.
|
|
56
|
+
# this is now here to prevent an error :)
|
|
57
|
+
if force:
|
|
58
|
+
logging.info("force is deprecated in logging - we always switch levels")
|
|
57
59
|
|
|
58
60
|
# Clear any existing handlers
|
|
59
61
|
root_logger = logging.getLogger()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: genome_entropy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Quantify information content across multiple biological representations derived from genomic sequences
|
|
5
5
|
Author-email: Rob Edwards <raedwards@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -43,9 +43,10 @@ Dynamic: license-file
|
|
|
43
43
|
# genome_entropy
|
|
44
44
|
|
|
45
45
|
[](https://edwards.flinders.edu.au/)
|
|
46
|
-
|
|
46
|
+
[](https://doi.org/10.5281/zenodo.18312206)
|
|
47
47
|
[](https://github.com/linsalrob/genome_entropy/actions)
|
|
48
|
-
[](https://linsalrob.github.io/genome_entropy/)
|
|
49
|
+
[](https://orf-entropy.readthedocs.io/en/latest/?badge=latest)
|
|
49
50
|
[](https://www.python.org/downloads/)
|
|
50
51
|
[](https://opensource.org/licenses/MIT)
|
|
51
52
|
|
|
@@ -93,3 +93,25 @@ def test_estimate_tokens_command_help() -> None:
|
|
|
93
93
|
assert "token size" in result.stdout.lower()
|
|
94
94
|
assert "model" in result.stdout.lower()
|
|
95
95
|
assert "device" in result.stdout.lower()
|
|
96
|
+
# Remove ANSI codes to check for options
|
|
97
|
+
import re
|
|
98
|
+
|
|
99
|
+
clean_output = re.sub(r"\x1b\[[0-9;]*m", "", result.stdout)
|
|
100
|
+
assert "--log-level" in clean_output
|
|
101
|
+
assert "--log-file" in clean_output
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def test_estimate_tokens_log_level_option() -> None:
|
|
105
|
+
"""Test that estimate-tokens accepts --log-level option."""
|
|
106
|
+
# Just checking help to ensure the option is recognized
|
|
107
|
+
result = runner.invoke(app, ["estimate-tokens", "--help"])
|
|
108
|
+
assert result.exit_code == 0
|
|
109
|
+
# Remove ANSI codes and check
|
|
110
|
+
import re
|
|
111
|
+
|
|
112
|
+
clean_output = re.sub(r"\x1b\[[0-9;]*m", "", result.stdout)
|
|
113
|
+
assert "--log-level" in clean_output
|
|
114
|
+
# Make sure it describes logging level
|
|
115
|
+
assert (
|
|
116
|
+
"logging level" in result.stdout.lower() or "log level" in result.stdout.lower()
|
|
117
|
+
)
|
|
@@ -134,20 +134,6 @@ def test_configure_logging_creates_parent_dirs():
|
|
|
134
134
|
assert log_file.parent.exists()
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
def test_configure_logging_no_reconfigure_without_force():
|
|
138
|
-
"""Test that logging is not reconfigured without force=True."""
|
|
139
|
-
configure_logging(level="INFO", force=True)
|
|
140
|
-
initial_level = get_log_level()
|
|
141
|
-
|
|
142
|
-
# Try to reconfigure without force (should not change)
|
|
143
|
-
configure_logging(level="DEBUG", force=False)
|
|
144
|
-
assert get_log_level() == initial_level
|
|
145
|
-
|
|
146
|
-
# Reconfigure with force (should change)
|
|
147
|
-
configure_logging(level="DEBUG", force=True)
|
|
148
|
-
assert get_log_level() == logging.DEBUG
|
|
149
|
-
|
|
150
|
-
|
|
151
137
|
def test_logging_format():
|
|
152
138
|
"""Test that logging format includes expected components."""
|
|
153
139
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
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
|
{genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy/encode3di/token_estimator.py
RENAMED
|
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
|
{genome_entropy-0.1.1 → genome_entropy-0.1.2}/src/genome_entropy.egg-info/dependency_links.txt
RENAMED
|
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
|