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

175 enable documentation process #375

Closed jschalk closed 2 weeks ago

jschalk commented 2 weeks ago

Summary by Sourcery

Refactor fiscal data processing by extracting logic into helper functions and enhance test coverage for database and fiscal data handling.

Enhancements:

Tests:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This PR implements several code improvements and refactoring changes across multiple files. The main changes include refactoring the fiscal build functionality, improving test organization, and adding new world-related features for handling documentation processes.

Class diagram for refactored fiscal build functions

classDiagram
    class FiscalUnit {
        +add_purviewepisode(x_owner_id, x_time_id, x_money_magnitude, allow_prev_to_current_time_entry)
        +add_cashpurchase(x_owner_id, x_acct_id, x_time_id, x_amount)
    }
    class DataFrame
    class FiscalBuild {
        +_get_fiscal_hours_dict(br00003_df: DataFrame)
        +_get_fiscal_months_dict(br00004_df: DataFrame)
        +_get_fiscal_weekdays_dict(br00005_df: DataFrame)
        +_add_purviewepisode(x_fiscalunit: FiscalUnit, br00001_df: DataFrame)
        +_add_cashpurchase(x_fiscalunit: FiscalUnit, br00002_df: DataFrame)
    }

Class diagram for WorldUnit with new directory management

classDiagram
    class WorldUnit {
        +_world_dir: str
        +_jungle_dir: str
        +_zoo_dir: str
        +_set_world_dirs()
        +jungle_to_zoo()
    }

Class diagram for BrickFileRef

classDiagram
    class BrickFileRef {
        +file_dir: str
        +file_name: str
        +sheet_name: str
        +brick_number: str
    }

File-Level Changes

Change Details Files
Refactored fiscal build functionality by extracting helper methods
  • Extracted _get_fiscal_hours_dict helper method
  • Extracted _get_fiscal_months_dict helper method
  • Extracted _get_fiscal_weekdays_dict helper method
  • Extracted _add_purviewepisode helper method
  • Extracted _add_cashpurchase helper method
  • Removed unnecessary print statements
src/f09_brick/brick.py
Added new world-related features for documentation handling
  • Added _set_world_dirs method to set up directory structure
  • Added jungle_to_zoo method for data transformation
  • Added BrickFileRef dataclass for file reference handling
  • Added new test files for world DB and jungle functionality
src/f10_world/world.py
src/f10_world/world_tool.py
src/f10_world/test/test_world_db.py
src/f10_world/test/test_world_jungle.py
Improved test organization and readability
  • Standardized test scenario naming
  • Updated test comments for consistency
  • Added docstrings to example data functions
  • Added more test cases for fiscal build functionality
src/f09_brick/test_brick_format/test_brick_models.py
src/f09_brick/test_fiscal_build/test_brick_fiscal_build.py
src/f09_brick/examples/brick_df_examples.py

Possibly linked issues


Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).