Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: initialize function, (long) structs, Model struct fields #351

Open
1 of 6 tasks
alimeshgi opened this issue Feb 9, 2024 · 3 comments
Open
1 of 6 tasks
Assignees
Labels
user-experience Improvements to the settings file, logging, error handling, etc. v1.0 Activities related to v1.0
Milestone

Comments

@alimeshgi
Copy link

alimeshgi commented Feb 9, 2024

Feature type

Changing existing functionality

Improvement Description

The current implementation contains long and complex initialization functions and data structures, leading to code redundancy, reduced maintainability, and potential performance issues. To address these issues, it's essential to reorganize initialize functions, divide lengthy structs into smaller sub-structs, and refactor data storage within the Model struct for improved organization and clarity.

Implementation Description

  1. Initialize Function Refactoring:
    Breakdown Long Functions: Separate long initialization functions into smaller, more manageable sub-functions based on logical units of functionality. This will enhance code readability, maintainability, and ease of debugging.
    Explicit Content Descriptions: Ensure that each sub-function has clear and explicit descriptions of its purpose and functionality to aid understanding and documentation.

  2. Struct Refactoring:
    Divide Lengthy Structs: Divide lengthy structs into smaller sub-structs to minimize overlap and improve modularity. This will make the codebase more organized, easier to navigate, and reduce the risk of errors.
    Extract Shared Components: Identify shared components within the structs (e.g., interception, snow, glacier) and pull them out into separate structs or modules to promote code reuse and maintainability.
    Consider Decoupling: Reorganize long structs to decouple vertical and horizontal concepts, ensuring a more modular and flexible architecture.

  3. Data Storage Refactoring:
    Use Structs for Data Storage: Refactor the storage of network, vertical, and lateral fields within the Model struct, replacing NamedTuples with Structs for better organization and readability. Explicitly define the contents of each struct member to enhance clarity and maintainability.

Additional Context

No response

Task overview

@alimeshgi alimeshgi added user-experience Improvements to the settings file, logging, error handling, etc. needs refinement issue still needs refinement v1.0 Activities related to v1.0 labels Feb 9, 2024
@verseve verseve changed the title Reorganize Initialize Functions and Refactor Refactor: initialize function, (long) structs, Model struct fields Feb 14, 2024
@alimeshgi alimeshgi added this to the 2024 - Q2 milestone Mar 21, 2024
@JoostBuitink
Copy link
Contributor

Issue #326 is linked to this refactor, and should be discussed in the design session

@JoostBuitink
Copy link
Contributor

#243 is also linked to this, and should be done in parallel

@verseve
Copy link
Contributor

verseve commented Mar 21, 2024

Also issues #225 and #348 should be considered in the design session/ refinement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-experience Improvements to the settings file, logging, error handling, etc. v1.0 Activities related to v1.0
Projects
None yet
Development

No branches or pull requests

3 participants