diff --git a/bbconf/__init__.py b/bbconf/__init__.py index 7452621d..a5286f63 100644 --- a/bbconf/__init__.py +++ b/bbconf/__init__.py @@ -1,4 +1,5 @@ import logging +from importlib.metadata import version import coloredlogs @@ -6,7 +7,9 @@ from .const import PKG_NAME -__all__ = ["BedBaseAgent"] +__version__ = version(__package__) + +__all__ = ["BedBaseAgent", "__version__"] _LOGGER = logging.getLogger(PKG_NAME) coloredlogs.install( diff --git a/bbconf/models/bed_models.py b/bbconf/models/bed_models.py index d16d0c51..c7056492 100644 --- a/bbconf/models/bed_models.py +++ b/bbconf/models/bed_models.py @@ -78,26 +78,28 @@ class BedStatsModel(BaseModel): class BedPEPHub(BaseModel): - sample_name: str = "" - genome: str = "" - organism: str = "" - species_id: str = "" - cell_type: str = "" - cell_line: str = "" - assay: str = Field("", description="Experimental protocol (e.g. ChIP-seq)") - library_source: str = Field( + sample_name: str | None = "" + genome: str | None = "" + organism: str | None = "" + species_id: str | None = "" + cell_type: str | None = "" + cell_line: str | None = "" + assay: str | None = Field("", description="Experimental protocol (e.g. ChIP-seq)") + library_source: str | None = Field( "", description="Library source (e.g. genomic, transcriptomic)" ) - genotype: str = Field("", description="Genotype of the sample") - target: str = Field("", description="Target of the assay (e.g. H3K4me3)") - antibody: str = Field("", description="Antibody used in the assay") - treatment: str = Field( + genotype: str | None = Field("", description="Genotype of the sample") + target: str | None = Field("", description="Target of the assay (e.g. H3K4me3)") + antibody: str | None = Field("", description="Antibody used in the assay") + treatment: str | None = Field( "", description="Treatment of the sample (e.g. drug treatment)" ) - tissue: str = Field("", description="Tissue type") - global_sample_id: str = Field("", description="Global sample identifier") - global_experiment_id: str = Field("", description="Global experiment identifier") - description: str = Field("", description="Description of the sample") + tissue: str | None = Field("", description="Tissue type") + global_sample_id: str | None = Field("", description="Global sample identifier") + global_experiment_id: str | None = Field( + "", description="Global experiment identifier" + ) + description: str | None = Field("", description="Description of the sample") model_config = ConfigDict(extra="allow", populate_by_name=True) @@ -107,35 +109,34 @@ class StandardMeta(BaseModel): Standardized Bed file metadata """ - species_name: str = Field( - default="", description="Name of species. e.g. Homo sapiens.", alias="organism" + species_name: str | None = Field( + default="", + description="Name of species. e.g. Homo sapiens.", + alias="organism", ) - species_id: str = "" - genotype: str = Field("", description="Genotype of the sample") - phenotype: str = Field("", description="Phenotype of the sample") + species_id: str | None = "" + genotype: str | None = Field("", description="Genotype of the sample") + phenotype: str | None = Field("", description="Phenotype of the sample") description: str | None = "" - cell_type: str = Field( - "", + cell_type: str | None = Field( + None, description="specific kind of cell with distinct characteristics found in an organism. e.g. Neurons, Hepatocytes, Adipocytes", ) - cell_line: str = Field( - "", + cell_line: str | None = Field( + None, description="population of cells derived from a single cell and cultured in the lab for extended use, e.g. HeLa, HepG2, k562", ) - tissue: str = Field("", description="Tissue type") + tissue: str | None = Field(None, description="Tissue type") - library_source: str = Field( - "", description="Library source (e.g. genomic, transcriptomic)" + library_source: str | None = Field( + None, description="Library source (e.g. genomic, transcriptomic)" ) - assay: str = Field( - "", - description="Experimental protocol (e.g. ChIP-seq)", - ) - antibody: str = Field("", description="Antibody used in the assay") - target: str = Field("", description="Target of the assay (e.g. H3K4me3)") - treatment: str = Field( - "", description="Treatment of the sample (e.g. drug treatment)" + assay: str | None = Field(None, description="Experimental protocol (e.g. ChIP-seq)") + antibody: str | None = Field(None, description="Antibody used in the assay") + target: str | None = Field(None, description="Target of the assay (e.g. H3K4me3)") + treatment: str | None = Field( + None, description="Treatment of the sample (e.g. drug treatment)" ) global_sample_id: list[str] | None = Field( @@ -145,7 +146,7 @@ class StandardMeta(BaseModel): None, description="Global experiment identifier. e.g. GSE000" ) # excluded in training - original_file_name: str = Field("", description="Original file name") + original_file_name: str | None = Field(None, description="Original file name") model_config = ConfigDict( populate_by_name=True, diff --git a/docs/changelog.md b/docs/changelog.md index 39ca0b25..2a6ceb2a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. +### [0.14.10] - 2026-04-05 +### Fixed: +- version info bug ### [0.14.9] - 2026-02-26 ### Changed: diff --git a/pyproject.toml b/pyproject.toml index 3d331252..0e5a2aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bbconf" -version = "0.14.9" +version = "0.14.10" description = "Configuration and data management tool for BEDbase" readme = "README.md" license = "BSD-2-Clause" @@ -32,7 +32,7 @@ dependencies = [ "zarr < 3.0.0", "pyyaml >= 6.0.1", "s3fs >= 2024.3.1", - "pandas < 3.0.0", + "pandas>2.0.0, < 3.0.0", "pybiocfilecache == 0.6.1", "umap-learn >= 0.5.8", "qdrant_client >= 1.16.1", diff --git a/tests/conftest.py b/tests/conftest.py index 58466de1..85d0b01b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -105,7 +105,11 @@ def example_dict(): "promoterprox_frequency": 16, "promoterprox_percentage": 17, }, - metadata={"sample_name": "sample_name_1"}, + metadata={ + "sample_name": "sample_name_1", + "species_name": "species_name", + "species_id": "123", + }, plots=plots, files=files, classification=classification, diff --git a/tests/test_bedfile.py b/tests/test_bedfile.py index 6312e29a..c6687574 100644 --- a/tests/test_bedfile.py +++ b/tests/test_bedfile.py @@ -215,7 +215,7 @@ def test_bed_update(self, bbagent_obj): with ContextManagerDBTesting(config=bbagent_obj.config, add_data=True): bed_file = bbagent_obj.bed.get(BED_TEST_ID, full=True) # assert bed_file.annotation.model_dump(exclude_defaults=True) == {} - assert bed_file.annotation.cell_line == "" + assert bed_file.annotation.cell_line is None new_metadata = { "cell_line": "K562",