Skip to content

Commit 4e1825a

Browse files
authored
32 upgrade as many packages to latest#2 (#46)
* Changed: dockerfile to install only main * Removed: unneeded packages * Changed: updated non-root requirements * fix: fixes for updating non-root requirements * changed: streamlined imports * added: tests for `variance_removal` * security: package updates * Changed: updated pydantic * changed: updated bio packages * fix: path printing error * Changed: loosened limits on package version already at max * Changed: updated lightgbm * fixed: changelog version * change: changelog update
1 parent 8704647 commit 4e1825a

File tree

15 files changed

+977
-666
lines changed

15 files changed

+977
-666
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ configs
1212
experiments
1313
data
1414
.vscode/settings.json
15-
playground.ipynb
15+
playground*.ipynb
1616
coverage.xml
1717
.coverage
1818
ao-env

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,29 @@
1818

1919
Change log for the codebase. Initialised from the developments following version `V0.11.3`
2020

21-
## [unreleased] - 2025-05-09
21+
## [version] - 2025-08-01
22+
23+
### Added
24+
25+
- Added: test case for variance threshold
26+
- Added: `.env' file to set some required env vars
27+
28+
### Changed
29+
30+
- changed: dockerfile to only install main dependencies
31+
- changed: streamlined imports
32+
- changed: updated as many packages as possible
33+
34+
### Fixed
35+
36+
- fix: omic path parsing bug
37+
- fix: plotting bug arising from api change
38+
39+
### Security
40+
41+
- security: updated packages to resolve dependabot alerts
42+
43+
## [v1.2.0] - 2025-05-09
2244

2345
### Changed
2446

@@ -186,6 +208,7 @@ Change log for the codebase. Initialised from the developments following version
186208
- Detect secrets added
187209
- Upgraded python base image from `3.9.14` to `3.9.18` for additional security fixes
188210

211+
[V1.2.0]: https://github.com/IBM/AutoXAI4Omics/releases/tag/V1.2.0
189212
[V1.1.1]: https://github.com/IBM/AutoXAI4Omics/releases/tag/V1.1.1
190213
[V1.1.0]: https://github.com/IBM/AutoXAI4Omics/releases/tag/V1.1.0
191214
[V1.0.1]: https://github.com/IBM/AutoXAI4Omics/releases/tag/V1.0.1

DEV_MANUAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Please use blacks & ruff to format any code contributions, we have a pre-commit
3030

3131
To create the virtual enviroment for AutoXAI4Omics using an enviroment manager of your choice, like conda for example, using `python3.9` as your starting point. Then proceed to install the contents of `pyproject.toml` for both the main and dev dependencies. Note that you may also need to set `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` within your enviroment.
3232

33-
*Note:* Since May '25 we have switched to using [Poetry](https://python-poetry.org/) for managing our env and dependencies which we also recommend to use. There is also an associated `poetry.lock` file to ensure consistent versions between developers.
33+
*Note:* Since May '25 we have switched to using [Poetry](https://python-poetry.org/) for managing our env and dependencies which we also recommend to use. There is also an associated `poetry.lock` file to ensure consistent versions between developers. If you also the poetry shell extension it will automatically load the `.env` file setting the env var mentioned above.
3434

3535
## Testing
3636

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ COPY --chown=omicsuser:0 poetry.lock pyproject.toml ./
3535
COPY --chown=omicsuser:0 autoxai4omics .
3636

3737
RUN poetry env use system
38-
RUN poetry install --no-root
38+
RUN poetry install --no-root --only main
3939
USER omicsuser
4040

4141
CMD ["$@"]

autoxai4omics/models/tabauto/keras_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from tensorflow.keras.layers import Dense, Flatten, Conv1D
2020
from tensorflow.keras import losses
2121

22-
import tensorflow.keras.optimizers.legacy
22+
from tensorflow.keras.optimizers.legacy import Adam
2323

2424
from tensorflow.keras.callbacks import (
2525
LearningRateScheduler,
@@ -95,7 +95,7 @@ def __init_ak__(self, input_dim, output_dim, dataset_type):
9595
objective=["val_loss"],
9696
tuner=self.tuner,
9797
seed=self.random_state,
98-
optimizer=tensorflow.keras.optimizers.legacy.Adam(),
98+
optimizer=Adam(),
9999
)
100100

101101
else:
@@ -117,7 +117,7 @@ def __init_ak__(self, input_dim, output_dim, dataset_type):
117117
objective=["accuracy"],
118118
tuner=self.tuner,
119119
seed=self.random_state,
120-
optimizer=tensorflow.keras.optimizers.legacy.Adam(),
120+
optimizer=Adam(),
121121
)
122122

123123
self.model = model
@@ -242,7 +242,7 @@ def __init_fx__(self, input_dim, output_dim, dataset_type):
242242
)
243243

244244
# choose optimizer
245-
opt = tensorflow.keras.optimizers.legacy.Adam()
245+
opt = Adam()
246246

247247
# choose loss function
248248
if self.dataset_type == REGRESSION:

autoxai4omics/omics/geneExp.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from omics import R_replacement as rrep
1717
import joblib
1818
import pandas as pd
19+
from pathlib import Path
1920

2021

2122
def get_data_gene_expression(
@@ -43,15 +44,19 @@ def get_data_gene_expression(
4344

4445
# add the output file name from config_dict that is required
4546
if config_dict["gene_expression"]["output_file_ge"] is not None:
46-
output_file = config_dict["gene_expression"]["output_file_ge"]
47+
output_file = str(
48+
config_dict["gene_expression"]["output_file_ge"].with_suffix("")
49+
)
4750
print("Output file: " + output_file)
4851
else:
4952
output_file = "processed_gene_expression_data"
5053
output_file += "_holdout" if holdout else ""
5154

5255
# add metadata output file from config_dict that is required
5356
if config_dict["gene_expression"]["output_metadata"] is not None:
54-
metout_file = config_dict["gene_expression"]["output_metadata"]
57+
metout_file = str(
58+
config_dict["gene_expression"]["output_metadata"].with_suffix("")
59+
)
5560
else:
5661
metout_file = "processed_gene_expression_metadata"
5762
metout_file += "_holdout" if holdout else ""

autoxai4omics/omics/metabolomic.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from omics import R_replacement as rrep
1717
import joblib
1818
import pandas as pd
19+
from pathlib import Path
1920

2021

2122
def get_data_metabolomic(
@@ -43,15 +44,15 @@ def get_data_metabolomic(
4344

4445
# add the output file name from config_dict that is required
4546
if config_dict["metabolomic"]["output_file_met"] is not None:
46-
output_file = config_dict["metabolomic"]["output_file_met"]
47+
output_file = str(config_dict["metabolomic"]["output_file_met"].with_suffix(""))
4748
print("Output file: " + output_file)
4849
else:
4950
output_file = "processed_metabolomic_data"
5051
output_file += "_holdout" if holdout else ""
5152

5253
# add metadata output file from config_dict that is required
5354
if config_dict["metabolomic"]["output_metadata"] is not None:
54-
metout_file = config_dict["metabolomic"]["output_metadata"]
55+
metout_file = str(config_dict["metabolomic"]["output_metadata"].with_suffix(""))
5556
else:
5657
metout_file = "processed_metabolomic_metadata"
5758
metout_file += "_holdout" if holdout else ""

autoxai4omics/omics/tabular.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from omics import R_replacement as rrep
1717
import joblib
1818
import pandas as pd
19+
from pathlib import Path
1920

2021

2122
def get_data_tabular(
@@ -43,7 +44,7 @@ def get_data_tabular(
4344

4445
# add the output file name from config_dict that is required
4546
if config_dict["tabular"]["output_file_tab"] is not None:
46-
output_file = config_dict["tabular"]["output_file_tab"]
47+
output_file = str(config_dict["tabular"]["output_file_tab"].with_suffix(""))
4748
print("Output file: " + output_file)
4849
else:
4950
output_file = "processed_tabular_data"
@@ -52,7 +53,7 @@ def get_data_tabular(
5253

5354
# add metadata output file from config_dict that is required
5455
if config_dict["tabular"]["output_metadata"] is not None:
55-
metout_file = config_dict["tabular"]["output_metadata"]
56+
metout_file = str(config_dict["tabular"]["output_metadata"].with_suffix(""))
5657
else:
5758
metout_file = "processed_tabular_metadata"
5859

autoxai4omics/plotting/importance/perm_imp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ def permut_importance(
125125
)
126126

127127
# Make a horizontal boxplot ordered by the magnitude
128-
ax = sns.boxplot(x=top_values, y=top_features, orient="h", ax=ax)
128+
129+
ax = sns.boxplot(
130+
pd.DataFrame(top_values, index=top_features).T, orient="h", ax=ax
131+
)
129132
if problem_type == CLASSIFICATION:
130133
ax.set_xlabel(f"{pretty_names(fit_scorer, 'score')} Decrease")
131134
else:

0 commit comments

Comments
 (0)