Repository navigation
Accept and serialize species and assembly_accession on base Genome (2.35.0) - #543
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #540 and fixes #542, bumping PyEnsembl to
2.35.0.speciesandassembly_accessionon baseGenome(Accept and serialize species and assembly_accession on base Genome #540):Genome.__init__accepts optionalspecies=None(Species | str | None, normalized viacheck_species_object, or inferred fromSpecies._reference_names_to_specieswhen omitted and not already set by a subclass) andassembly_accession=None(str | None, validated non-empty string).Genome._resolve_reference_metadatapassesspecies=self.speciestoresolve_reference_metadata(...)so custom/rapid-release assemblies with unregisteredreference_name(such asT2T-CHM13v2.0/GCA_009914755.4) automatically resolve species taxonomy and nuclear/mitochondrial/plastid translation tables and validate consistency against any explicittaxon_id.Genome.assembly_accessionis exposed as a property with a validating setter soEnsemblRelease's read-only property overrides it cleanly while existing subclasses (such asorfdata.PinnedEnsemblGenome) that assignself.assembly_accession = ...aftersuper().__init__remain 100% compatible.Genome.to_dict()serializesspecies(latin_nameorNone) andassembly_accession, andGenome._fields()includes both in equality and hashing; legacy saved JSON/dict payloads omitting those keys continue to load cleanly.EnsemblRelease.with_mirror(...)forwardsspeciesandassembly_accessionto the returnedGenome.datacache 1.32.0(Update test_cli_database_recovery.py for datacache 1.32.0 atomic corrupt-DB replacement #542):openvax/datacache#151(datacache 1.32.0) replaced in-place ctypes SQLite recovery with atomicos.replace()from a complete staged sibling (preserving file mode). Updatedtests/test_cli_database_recovery.pyto assert preserved mode, DB integrity/queryability, intact source GTF, and reuse across bothdatacache 1.30-1.31and>=1.32.0.Verification
./lint.sh(ruff + mypy): pass./test.shsuite (1171 passedunderdatacache 1.32.0): pass