Skip to content

Conversation

@pesap
Copy link
Collaborator

@pesap pesap commented May 18, 2025

This pull request updates documentation and CI workflows to modernize time series terminology, introduce new features, and improve flexibility for time series data storage and testing. The most significant changes are the addition of a comprehensive guide to storage backends, updates to time series terminology, and improvements to the CI/CD pipeline to use uv for Python environment management.

Documentation Improvements

  • Added a new guide, docs/how_tos/storage_backends.md, detailing all available time series storage backends (In-Memory, Arrow, Chronify, HDF5), how to select and switch between them, configuration options, performance considerations, and benchmarking examples.
  • Updated time series terminology in documentation to use name instead of variable_name, and clarified class references (e.g., {py:class}infrasys.time_series_models.SingleTimeSeries). [1] [2] [3]
  • Added documentation for deterministic time series classes (DeterministicTimeSeries, DeterministicSingleTimeSeries) with usage examples.

CI/CD Workflow Modernization

  • Migrated CI workflows (.github/workflows/ci.yml, .github/workflows/gh-pages.yml) to use uv for Python environment setup and dependency management, replacing setup-python and pip. This streamlines and speeds up dependency installation and test runs. [1] [2] [3]

General Documentation Enhancements

  • Added new section headers and improved formatting in various documentation files for clarity and consistency. [1] [2]

These changes collectively improve the usability, clarity, and maintainability of both the documentation and the development workflow.

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2025

Codecov Report

❌ Patch coverage is 90.71181% with 107 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.17%. Comparing base (f2c90ab) to head (53b111c).

Files with missing lines Patch % Lines
src/infrasys/chronify_time_series_storage.py 45.45% 24 Missing ⚠️
src/infrasys/h5_time_series_storage.py 91.24% 19 Missing ⚠️
src/infrasys/arrow_storage.py 88.99% 12 Missing ⚠️
src/infrasys/in_memory_time_series_storage.py 75.60% 10 Missing ⚠️
src/infrasys/system.py 90.99% 10 Missing ⚠️
src/infrasys/time_series_metadata_store.py 95.09% 8 Missing ⚠️
src/infrasys/time_series_manager.py 93.00% 7 Missing ⚠️
src/infrasys/migrations/db_migrations.py 92.64% 5 Missing ⚠️
src/infrasys/time_series_models.py 97.36% 4 Missing ⚠️
src/infrasys/utils/metadata_utils.py 93.44% 4 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   95.56%   91.17%   -4.39%     
==========================================
  Files          49       37      -12     
  Lines        4328     3422     -906     
==========================================
- Hits         4136     3120    -1016     
- Misses        192      302     +110     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pesap pesap requested a review from Copilot October 1, 2025 21:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This is a major version release (v1.0.0) that introduces significant breaking changes to the infrasys library, primarily focusing on time series functionality enhancements, API refactoring, and database schema improvements.

  • Adds new deterministic time series support with Deterministic and DeterministicSingleTimeSeries classes
  • Migrates from variable_name to name and user_attributes to features across the API
  • Introduces HDF5 storage backend and migrates from json to orjson for performance
  • Implements database schema migration system for backwards compatibility

Reviewed Changes

Copilot reviewed 46 out of 47 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_time_utils.py Adds tests for new str_timedelta_to_iso_8601 function
tests/test_time_series_metadata_store_migration.py New test file for database migration functionality
tests/test_system.py Updates API calls from variable_name to name and user_attributes to features
tests/test_single_time_series.py Updates API calls and import order for consistency
tests/test_serialization.py Updates API calls and adds @pytest.mark.xfail for deprecated normalization
tests/test_nonsequential_time_series.py Updates API calls and import order
tests/test_in_memory_storage.py Updates API calls and import order
tests/test_h5_storage.py New test file for HDF5 storage backend
tests/test_deterministic_time_series.py New test file for deterministic time series functionality
tests/test_cost_curves.py Adds startup_fuel_offtake field to FuelCurve
tests/test_base_quantity.py Minor import order fixes
tests/test_arrow_storage.py Updates API calls and import order
tests/conftest.py Updates API calls in test fixtures
src/infrasys/utils/time_utils.py Adds str_timedelta_to_iso_8601 utility function
src/infrasys/utils/path_utils.py Adds clean_tmp_folder utility function
src/infrasys/utils/metadata_utils.py New utility file for metadata handling functions
src/infrasys/time_series_storage_base.py Updates method signatures from connection to context
src/infrasys/time_series_models.py Major refactor adding deterministic time series and API changes
src/infrasys/time_series_metadata_store.py Complete rewrite for new database schema and API
src/infrasys/time_series_manager.py Updates for new API and adds HDF5 support
src/infrasys/system.py Updates for new API and adds migration support
src/infrasys/supplemental_attribute_associations.py Minor index creation fixes
src/infrasys/supplemental_attribute.py Updates serialization metadata handling
src/infrasys/serialization.py Refactors type metadata handling
src/infrasys/migrations/metadata_migration.py New migration system for component metadata
src/infrasys/migrations/db_migrations.py New migration system for database schema
src/infrasys/in_memory_time_series_storage.py Updates for new API
src/infrasys/h5_time_series_storage.py New HDF5 storage backend implementation
src/infrasys/cost_curves.py Adds startup_fuel_offtake field
src/infrasys/component.py Updates serialization metadata handling
src/infrasys/chronify_time_series_storage.py Updates for new API
src/infrasys/arrow_storage.py Updates for new API and adds deterministic time series support
src/infrasys/init.py Adds new exports and version constants
scripts/json_performance.py New performance benchmarking script
scripts/conftest.py Configuration for benchmarking scripts
pyproject.toml Adds new dependencies and dev tools
docs/ Multiple documentation updates for new features
.github/workflows/ci.yml Updates CI to use uv package manager
Comments suppressed due to low confidence (1)

src/infrasys/migrations/db_migrations.py:1

  • Typo in comment: 'tehe' should be 'the'.
import json

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

pesap and others added 6 commits October 3, 2025 11:49
* ci: Adding mypy fix

* fix: Adding missing ignore imports directly on the runner

* fix: Adding new version of the metadata store according to feedback

* fix: Adding display of `timedelta` to the info.

* fix: Closing connection for Windows

* fixup! fix: Closing connection for Windows

* feat: Adding same function to serialize features.

* fix: Renaming old functions with user attributes to features.

* fix: Removing references for variable name

* fix: Updating metadata store to match IS.jl

* fix: CI to reflect migration from normalization

* fix: Removing stale code
* feat: Add `orjson` as a dependency.
* feat: Adding `orjson` as the default json dump load mechanism
* ci: Updating CI to UV
* docs: Move tutorial to right folder.
* fix: Bug where we were saving the features as bytes instead of string.
* fix: removing repeated logic
* feat: Adding h5py backend and propagating changes of variable_name ->
name

* docs: Adding documentation for backends

* chore: Cleaning code

* fixup! chore: Cleaning code
* feat: Adding new `DeterministicTimeSeries`

* feat: Propagating changes of DeterministicTimeSeries to other backends
and adding documentation

* tests: Improving testing

* fixes: #95 (comment)

* fix: Changing order to match IS.jl

* fix: Addressing #95 (comment)

* fix: Addressing: #95 (comment)
* feat: Adding new `DeterministicTimeSeries`

* feat: Propagating changes of DeterministicTimeSeries to other backends
and adding documentation

* tests: Improving testing

* fixes: #95 (comment)

* fix: Changing order to match IS.jl

* fix: Addressing #95 (comment)

* fix: Addressing: #95 (comment)

* update formatting of initial_timestamp

* move initial_timestamp formatting to metadata_utils

---------

Co-authored-by: pesap <[email protected]>
@pesap pesap requested a review from daniel-thom October 3, 2025 18:54
@pesap pesap marked this pull request as ready for review October 3, 2025 18:54
@pesap pesap requested a review from Copilot October 3, 2025 18:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 46 out of 48 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

tests/test_system.py:848

  • The removal of the test_time_series_uniqueness_queries function removes important test coverage for time series uniqueness validation and query functionality. This test was validating behavior when multiple time series types are attached to the same component.
    assert not system.has_time_series(gen, name=ts_name)


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

pesap and others added 7 commits October 3, 2025 13:50
… on `Deterministic` (#109)

* refactor: Removing `DeterministicSingleTimeSeries` in favor of a method
on `Deterministic`
* fix: Added patch for IS.jl compatibility
* test: Improving test coverage
* fix: Removing unnecesary convertion to pint.
* feat: Adding method to load system from a zip file

List of changes:
- Implemented a new System.load() method that enables loading systems from zip archives, automatically extracting the archive to a temporary directory, deserializing the system, and cleaning up temporary files while preserving time series storage files in permanent locations.
- Added a deserialize() classmethod to all storage backend classes (Arrow, Chronify, HDF5, and InMemory), which abstracts backend-specific deserialization logic and handles the copying of storage files from temporary extraction directories to permanent locations before cleanup.
- Refactored TimeSeriesManager.deserialize() to use a delegation pattern with the new TIME_SERIES_REGISTRY dictionary,.
- Created TIME_SERIES_REGISTRY as a global dictionary mapping TimeSeriesStorageType enum values to storage backend classes.
* test: Adding testing for load system
Fix missing time series after deserialization
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.

5 participants