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

Closed jschalk closed 1 month ago

jschalk commented 1 month ago

Summary by Sourcery

Refactor the OutlayEvent class to replace _magnitude with purview, update related methods and tests, and enhance the hubunit class with new methods for handling outlay calculations and file retrievals.

Enhancements:

Tests:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request implements several changes to the finance and budgeting system, focusing on refactoring and enhancing the OutlayEvent and HubUnit classes. The changes include introducing a new 'purview' attribute, updating method signatures, and improving the calculation of timepoint outlays.

No sequence diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Introduced 'purview' attribute to OutlayEvent class
  • Added 'purview' attribute to OutlayEvent class
  • Updated OutlayEvent constructor and shop function to include 'purview'
  • Modified get_dict method to include 'purview' in the returned dictionary
  • Changed 'magnitude' to be an optional parameter in the constructor
src/f1_road/finance_outlay.py
src/f1_road/test/test_finance_outlay.py
Refactored HubUnit class to improve outlay calculations
  • Added calc_timepoint_outlay method to calculate outlays for a specific timepoint
  • Implemented calc_timepoint_outlays method to calculate outlays for all timepoints
  • Added get_outlay_file and get_budpoint_file methods to retrieve saved files
  • Updated _save_valid_outlay_file and _save_valid_budpoint_file to allow file replacement
src/f5_listen/hubunit.py
src/f5_listen/test_hubunit/test_hubunit_timeline.py
Updated test cases to reflect changes in OutlayEvent and HubUnit classes
  • Modified existing tests to use 'purview' instead of 'magnitude' where appropriate
  • Added new tests for calc_timepoint_outlay and calc_timepoint_outlays methods
  • Updated assertions to check for the new 'purview' attribute
src/f1_road/test/test_finance_outlay.py
src/f5_listen/test_hubunit/test_hubunit_timeline.py
Renamed and updated bud_tool functions
  • Renamed get_bud_settle_net_dict to get_bud_settle_acct_net_dict
  • Updated function calls and imports to use the new function name
src/f2_bud/bud_tool.py
src/f2_bud/test_bud_tool/test_get_outlays.py
Added new example functions and updated existing ones
  • Added get_budunit_3_acct function to create a BudUnit with 3 accounts
  • Added get_outlayevent_88_example function to create an example OutlayEvent
  • Updated existing example functions to use the new 'purview' attribute
src/f5_listen/examples/example_listen_buds.py
src/f5_listen/examples/example_listen_outlays.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. #### 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/sourceryai/) or [GitHub](https://github.com/sourcery-ai).