Skip to content

Fix pandas 2.0 incompatibility and parameterize load_biome_herarchy_dict#10

Open
bleedblack1 wants to merge 1 commit intoFinn-Lab:masterfrom
bleedblack1:pandas-fix
Open

Fix pandas 2.0 incompatibility and parameterize load_biome_herarchy_dict#10
bleedblack1 wants to merge 1 commit intoFinn-Lab:masterfrom
bleedblack1:pandas-fix

Conversation

@bleedblack1
Copy link

This PR fixes two issues in utils.py.

  1. Fix pandas 2.0 incompatibility

Problem:
Series.iteritems() was removed in pandas 2.0, causing an AttributeError.

Fix:
Replaced Series.iteritems() with Series.items() in split_tt().

Additional improvement:
Replaced type(lin) == str with isinstance(lin, str) in split_tt() and i_T().

  1. Parameterize load_biome_herarchy_dict()
    Problem:
    load_biome_herarchy_dict() always resolved the biome hierarchy file through
    TaxonomyToVectorParams even when called from other components.

Because the function used an LRU cache, the resolved path was shared across
callers regardless of the pipeline.

Fix:
Added optional parameters:

model_name
model_version

These allow callers to explicitly specify the model repository while keeping
backward-compatible defaults.

resolved issue: #7 #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant