Skip to content
New issue

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

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

Already on GitHub? # to your account

Abstract functionality out of main. #214

Closed
3 tasks done
Autoparallel opened this issue Apr 18, 2023 · 3 comments · Fixed by #220
Closed
3 tasks done

Abstract functionality out of main. #214

Autoparallel opened this issue Apr 18, 2023 · 3 comments · Fixed by #220
Assignees
Labels
📦 structural changes refactoring, reorganization, or file structure

Comments

@Autoparallel
Copy link
Collaborator

Autoparallel commented Apr 18, 2023

We should make all of the functionality in main as simple as possible so that it is just clap. For example, for sim we have this snippet:

async fn main() -> Result<(), Box<dyn Error>> {
    let args = Args::parse();

    match &args.command {
        Some(Commands::Sim { config: _ }) => {
            sim::sim()?;
        }
 }

This will let us grow the cli handling without making main unbelievably large. For each leg of the match &args.command, make each a single line command like sim::sim()?.

  • Move the logic for chain out of main.rs and into chain.rs.
  • Move the logic of gbm out of main.rs and into gbm.rs.
  • Move the logic of ou out of main.rs and into ou.rs.
@Autoparallel Autoparallel added Tech-Debt 📦 structural changes refactoring, reorganization, or file structure labels Apr 18, 2023
@Autoparallel Autoparallel added this to the Simulation Testing milestone Apr 18, 2023
@Autoparallel Autoparallel self-assigned this Apr 21, 2023
@Autoparallel
Copy link
Collaborator Author

@0xEstelle I think you can take care of the tasks 2 and 3 here with your branch.

@FiberedSkies
Copy link
Contributor

Def can!! Currently i have all the price processes defined in one file price_process.rs. are you thinking of isolating one each to its own file?

@FiberedSkies
Copy link
Contributor

done

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
📦 structural changes refactoring, reorganization, or file structure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants