Closed AlexTheWizardL closed 3 weeks ago
Attention: Patch coverage is 99.34211%
with 1 line
in your changes missing coverage. Please review.
Files with missing lines | Patch % | Lines |
---|---|---|
pyledger/standalone_ledger.py | 96.77% | 1 Missing :warning: |
Flag | Coverage Δ | |
---|---|---|
unittests | 80.10% <99.34%> (+2.49%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Files with missing lines | Coverage Δ | |
---|---|---|
pyledger/constants.py | 100.00% <100.00%> (ø) |
|
pyledger/ledger_engine.py | 69.46% <100.00%> (+2.50%) |
:arrow_up: |
pyledger/memory_ledger.py | 94.17% <100.00%> (+1.67%) |
:arrow_up: |
pyledger/text_ledger.py | 96.09% <100.00%> (+0.88%) |
:arrow_up: |
pyledger/standalone_ledger.py | 73.17% <96.77%> (+3.12%) |
:arrow_up: |
Merged. Thanks for the good foundation for accessors and mutators of future entities ...
Complete Interfaces and Implement Accessor, Mutator, and Mirroring Methods for TextLedger and MemoryLedger
Overview:
This pull request finalizes several key interfaces and introduces robust asset management functionality for both
MemoryLedger
andTextLedger
, focusing on accessor, mutator, and mirroring methods. It also includes updates to precision handling, asset standardization, and test coverage.Key Changes:
Completion of Interfaces:
MemoryLedger
andTextLedger
.Implementation of Mirroring Logic and Introduction of
sanitize_assets
Method:mirror_assets
method to synchronize the current ledger state with a target state. The method adds missing assets, updates existing ones, and (optionally) deletes assets that are no longer present in the target.sanitize_assets
method to ensure that asset data adheres to the required schema before mirroring operations. This improves data integrity and consistency across operations.Implementing Accessor and Mutator Methods for
MemoryLedger
:add_asset
,modify_asset
, anddelete_asset
) for managing assets inMemoryLedger
.ticker
anddate
, with proper error handling for duplicates or non-existent assets.Adding Base Tests for Assets:
MemoryLedger
andTextLedger
.None
dates).Updating Usage of Precision:
precision
method to correctly retrieve theincrement
value for assets based on theticker
anddate
.None
dates are properly handled by treating them aspd.NaT
, making it easier to compare and manipulate assets with or without specific dates.Implementing Accessor and Mutator Methods for
TextLedger
:TextLedger
, including reading and writing assets to CSV files.add_asset
,modify_asset
, anddelete_asset
now work withTextLedger
, ensuring assets are correctly read from and written toassets.csv
files in a fixed-width format suitable for version control.Review Recommendation:
It is recommended to review the changes commit by commit to understand the incremental updates and ensure proper context for each stage of implementation.