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 #364

Closed jschalk closed 3 weeks ago

jschalk commented 3 weeks ago

Summary by Sourcery

Refactor the brick configuration by simplifying the structure and updating the pandas tool functions for improved clarity. Update the test suite to ensure compatibility with these changes.

Enhancements:

Tests:

sourcery-ai[bot] commented 3 weeks ago

Reviewer's Guide by Sourcery

This pull request refactors the brick configuration system and related tools to simplify the data structure and improve functionality. The main changes include removing nested attributes in favor of a simpler flat structure, updating the pandas tool functions for better sorting and filtering capabilities, and modifying the BrickRef class to use a set-based approach for attributes.

Updated ER diagram for brick configuration

erDiagram
    BRICK_CONFIG {
        STRING allowed_crud
        STRING brick_type
        JSON optional_args
        JSON required_args
    }
    BRICK_CONFIG ||--o{ OPTIONAL_ARGS : contains
    BRICK_CONFIG ||--o{ REQUIRED_ARGS : contains
    OPTIONAL_ARGS {
        STRING key
        JSON value
    }
    REQUIRED_ARGS {
        STRING key
        JSON value
    }
    note for BRICK_CONFIG "Simplified structure by removing nested attributes"

Updated class diagram for BrickRef

classDiagram
    class BrickRef {
        +String brick_name
        +String categorys
        +Set attributes
        +set_attribute(String x_attribute)
        +List get_headers_list()
    }
    note for BrickRef "Refactored to use a set for attributes instead of a dictionary for brick columns"

File-Level Changes

Change Details Files
Simplified brick configuration structure by flattening attributes and standardizing required/optional arguments
  • Removed nested attribute structures with column_order and sort_order
  • Standardized brick types to 'budunit', 'fiscalunit', and 'filterunit'
  • Added face_id and eon_id as required attributes across all brick types
  • Simplified attribute definitions to use empty objects instead of detailed specifications
src/f09_brick/brick_config.json
src/f09_brick/brick_formats/*.json
Enhanced pandas tool functions with improved sorting and type handling
  • Added get_brick_elements_sort_order function for consistent column ordering
  • Implemented get_brick_sqlite_type function for SQLite data type mapping
  • Updated get_ordered_csv to handle new sorting requirements
  • Modified get_new_sorting_columns to work with the updated structure
src/f09_brick/pandas_tool.py
src/f09_brick/test_brick_config/test_pandas_tool.py
Refactored BrickRef class to use a set-based approach for attributes
  • Replaced BrickColumn class with a simpler set-based attribute system
  • Updated attribute handling methods to work with the new set structure
  • Modified headers list generation to use the new attribute system
  • Updated tests to reflect the new attribute handling approach
src/f09_brick/brick.py
src/f09_brick/test_brick_format/test_brick_column.py
src/f09_brick/test_brick_format/test_brick_format_config.py

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).
sourcery-ai[bot] commented 3 weeks ago

🧙 Sourcery is reviewing your pull request!


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).