jschalk / jaar

Cross-cultural communication engine built on customizable economic systems. Produces personalized agendas, calendars, finance reports for users.
0 stars 1 forks source link

283 refactor the range management system in ideaunits #290

Closed jschalk closed 2 months ago

jschalk commented 2 months ago

Summary by Sourcery

Refactor the range management system in 'ideaunits' by introducing a new timeline configuration system with validation. Update functions and tests to support the new system, and remove obsolete code.

New Features:

Enhancements:

Tests:

Chores:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request refactors the range management system in the ideaunits module, focusing on improving the flexibility and configurability of the timeline system. The changes introduce a new timeline configuration approach, update function signatures, and modify the structure of time-related data.

File-Level Changes

Change Details Files
Introduced a new timeline configuration system
  • Added a validate_timeline_config function to check the validity of timeline configurations
  • Created a new JSON configuration file for the Gregorian timeline
  • Updated functions to use the new configuration system
  • Replaced hardcoded values with configuration-based values
src/chrono/chrono.py
src/chrono/examples/creg_timeline_config.json
src/chrono/examples/chrono_examples.py
Refactored time-related functions for improved flexibility
  • Modified week_length function to accept a parameter
  • Updated get_time_min_from_dt to use a configurable offset
  • Renamed some time-related functions for consistency
  • Removed deprecated or unused functions
src/chrono/chrono.py
src/chrono/test/test_cregtime_config.py
src/chrono/test/test_cregtime_ideaunits_status.py
Updated test cases to reflect new timeline configuration system
  • Modified existing tests to use the new configuration-based approach
  • Added new tests for the validate_timeline_config function
  • Updated test data to match the new configuration format
src/chrono/test/test_cregtime_config.py
src/chrono/test/test_chrono_config.py
Reorganized and renamed some files and functions
  • Moved creg-related functionality from src/creg/creg.py to src/chrono/examples/chrono_examples.py
  • Renamed some functions for clarity and consistency (e.g., get_time_min_from_dt to get_creg_min_from_dt)
  • Updated import statements to reflect the new file structure
src/chrono/examples/chrono_examples.py
src/chrono/test/test_cregtime_config.py
src/chrono/test/test_cregtime_ideaunits_status.py
Made minor updates to example data and test cases
  • Updated example bud files with renamed labels (e.g., 'WaterAir Living' to 'Water Living')
  • Modified some test case data to reflect changes in the timeline system
src/bud/examples/example_bud1.json
src/bud/examples/example_bud2.json
src/_road/test/test_finance_scale_distribution.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.