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 io into reading and processing and create table tree structure #607

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

abelsiqueira
Copy link
Member

@abelsiqueira abelsiqueira commented Apr 23, 2024

The function to create graph et al from a csv folder has been split into two functions. The first reads the csv folder into a new TableTree structure. The second processes the TableTree structure into graph et al.

Pull request details

Describe the changes made in this pull request

List of related issues or pull requests

Closes #544

Collaboration confirmation

As a contributor I confirm

  • I read and followed the instructions in README.dev.md
  • The documentation is up to date with the changes introduced in this Pull Request (or NA)
  • Tests are passing
  • Lint is passing

The function to create graph et al from a csv folder has been split into
two functions. The first reads the csv folder into a new TableTree
structure. The second processes the TableTree structure into graph et
al.
@abelsiqueira abelsiqueira added the benchmark PR only - Run benchmark on PR label Apr 23, 2024
Copy link
Contributor

github-actions bot commented Apr 23, 2024

Benchmark Results

49a243d... 4b606a5... 49a243d.../4b606a57a4e1e1...
energy_problem/create_model 0.106 ± 0.0055 h 0.106 ± 0.005 h 0.996
energy_problem/input_and_constructor 26.9 ± 0.37 s 27.3 ± 0.42 s 0.987
time_to_load 2.56 ± 0.012 s 2.55 ± 0.0054 s 1
49a243d... 4b606a5... 49a243d.../4b606a57a4e1e1...
energy_problem/create_model 0.749 G allocs: 31.2 GB 0.749 G allocs: 31.2 GB 1
energy_problem/input_and_constructor 0.249 G allocs: 4.34 GB 0.249 G allocs: 4.34 GB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

Copy link
Member

@suvayu suvayu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks pretty straight forward to me. I only have one comment. This still assumes everything is read from CSV, e.g, create_input_dataframes_from_csv_folder directly creates the table_tree. It would be nice if you could split this into:

flowchart LR
    A[file] -->B(DataFrame)
    subgraph "in Julia (TEM)"
    B --> C(TableTree)
    end
Loading

Then TIO can easily replace "reading from file"

flowchart LR
    A[TIO] -->B(DataFrame)
    subgraph TEM
    B --> C(TableTree)
    end
Loading

@abelsiqueira
Copy link
Member Author

Thanks for the review. It's true, eventually we'll have to split more, but it will also depend on TulipaClustering.jl, so I'm ignoring it for now.

@abelsiqueira abelsiqueira merged commit 29814b7 into main Apr 26, 2024
14 checks passed
@abelsiqueira abelsiqueira deleted the 544-refactor-io branch April 26, 2024 09:21
@suvayu
Copy link
Member

suvayu commented Apr 26, 2024

The longer this is delayed, longer I've to code without a clear target. It's one of the reasons reading ESDL has been slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark PR only - Run benchmark on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate the reading and processing in the IO
2 participants