Skip to content

Optimize Pv4 Data Resource class#1255

Open
Thirumalai-Nambi-S wants to merge 1 commit intomalariagen:masterfrom
Thirumalai-Nambi-S:master
Open

Optimize Pv4 Data Resource class#1255
Thirumalai-Nambi-S wants to merge 1 commit intomalariagen:masterfrom
Thirumalai-Nambi-S:master

Conversation

@Thirumalai-Nambi-S
Copy link
Copy Markdown

Optimized Pv4 Data Resource Class

What’s improved:

  1. Cached default config path:

    • The path to 'pv4_config.json' is computed only once using lru_cache.

    • Avoids repeated calls to os.path.abspath and os.path.dirname
      when multiple Pv4 instances are created.

  2. Cleaner fallback logic:

    • Uses Pythonic 'data_config or default' pattern instead of explicit condition.

  3. Proper kwargs forwarding:

    • Ensures any additional filesystem arguments (**kwargs) are passed
      to the parent class (important for fsspec configurations like authentication, caching, etc.)

Optimized the Pv4 Data Resource class by caching the default config path, improving fallback logic, and ensuring proper kwargs forwarding.
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