Closed jschalk closed 1 week ago
This PR implements a major refactoring of the pidgin/bridge functionality, focusing on renaming and restructuring components to improve code clarity and maintainability. The changes include renaming key functions and attributes, adding new functionality for handling Excel sheets, and introducing a new brick format for account translations.
classDiagram
class WorldUnit {
+WorldID world_id
+str worlds_dir
+TimeLinePoint current_time
+dict[TimeLinePoint, AcctID] events
+dict[AcctID, PidginUnit] pidgins
+dict[TimeLineLabel, TimeConversion] timeconversions
+str _events_dir
+str _pidgins_dir
+set[FiscalID] _fiscalunits
+str _world_dir
+str _jungle_dir
+str _zoo_dir
+set_event(event_id: TimeLinePoint, face_id: AcctID)
+event_exists(event_id: TimeLinePoint) bool
+get_event(event_id: TimeLinePoint) AcctID
+set_pidginunit(x_pidginunit: PidginUnit)
+add_pidginunit(face_id: AcctID)
+pidginunit_exists(face_id: AcctID) bool
+get_pidginunit(face_id: AcctID) PidginUnit
+del_pidginunit(face_id: TimeLinePoint)
+del_all_pidginunits()
+pidgins_empty() bool
+_pidgin_dir(face_id: AcctID) str
+save_pidginunit_files(face_id: AcctID)
+pidgin_dir_exists(face_id: AcctID) bool
+_set_all_pidginunits_from_dirs()
+_delete_pidginunit_dir(event_id: TimeLinePoint)
+load_pidginunit_from_files(face_id: AcctID)
+set_events_from_events_agg()
+otx_to_otxinx_staging()
}
class OtxToOtx2InxPiginTransformer {
+str zoo_dir
+set[TimeLinePoint] legitmate_events
+transform()
+insert_legitmate_brick_otx2inx(brick_number: str, zoo_brick_path: str, otx2inx_columns: list[str], otx2inx_df: DataFrame)
}
WorldUnit --> OtxToOtx2InxPiginTransformer
class BridgeUnit {
+dict otx2inx
+str unknown_word
+str otx_road_delimiter
+str inx_road_delimiter
+dict nub_label
+str jaar_type
+OwnerID face_id
+set_all_otx2inx(x_otx2inx: dict, raise_exception_if_invalid: bool)
+set_otx2inx(otx_word: str, inx_word: str)
+_get_inx_value(otx_word: str) str
+get_create_inx(otx_word: str, missing_add: bool) str
+_get_create_roadunit_inx(otx_road) RoadUnit
+_get_nub_roadnode(x_roadNode: RoadNode) RoadNode
+otx2inx_exists(otx_word: str, inx_word: str) bool
+otx_exists(otx_word: str) bool
+del_otx2inx(otx_word: str)
+set_nub_label(otx_label: RoadNode, inx_label: RoadNode)
+_set_new_nub_label_to_otx_inx(otx_label, inx_label)
+_get_nub_inx_label(otx_label: RoadNode) RoadNode
+nub_label_exists(otx_label: RoadNode, inx_label: RoadNode) bool
+nub_otx_label_exists(otx_label: RoadNode) bool
+del_nub_label(otx_label: RoadNode)
+_unknown_word_in_otx2inx() bool
+_otx_road_delimiter_in_otx_words() bool
+_inx_road_delimiter_in_otx_words() bool
+_otx_road_delimiter_in_inx_words() bool
+_inx_road_delimiter_in_inx_words() bool
+_is_otx_delimiter_inclusion_correct() bool
+_is_inx_delimiter_inclusion_correct() bool
+all_otx_parent_roads_exist() bool
+get_dict() dict
+get_json() str
}
Change | Details | Files |
---|---|---|
Renamed pidgin/bridge-related functions and attributes to improve clarity |
|
src/f08_pidgin/pidgin.py src/f08_pidgin/test_pidgin/test_bridgeunit_.py src/f08_pidgin/pidgin_config.json |
Added new Excel sheet handling functionality |
|
src/f09_brick/pandas_tool.py src/f10_world/test/test_world_jungle_to_zoo.py |
Added new brick format for account translations |
|
src/f09_brick/brick_formats/brick_format_00113_acct_otx2inx_v0_0_0.json src/f09_brick/brick_models.py src/f09_brick/brick_config.json |
Refactored file path handling |
|
src/f00_instrument/file.py src/f10_world/test/test_world_db.py src/f09_brick/test_brick_config/test_pandas_tool_.py |
Summary by Sourcery
Refactor the codebase to improve consistency in path creation and enhance the 'WorldUnit' class with new pidgin management capabilities. Update and expand test coverage to ensure reliability of the new and modified functionalities.
Enhancements:
Tests: