EnergySystemsModellingLab / MUSE_2.0

Welcome to the MUSE 2.0 repository
GNU General Public License v3.0
1 stars 0 forks source link

Move example code into subfolder #73

Closed alexdewar closed 3 months ago

alexdewar commented 3 months ago

Currently all the example code is contained in the main cargo package for this repository, called muse2. The problem is that this is not super-hackable -- there's enough code in there that it will be somewhat fiddly to start work on reading the new input files without accidentally breaking the build or functionality of the example code.

Accordingly, I've moved the example code into its own subfolder for reference and replaced the main muse2 crate with some simple skeleton code.

Closes #72.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (0aed712) to head (0f4084d).

Files Patch % Lines
src/muse2.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #73 +/- ## ========================================== - Coverage 81.81% 0.00% -81.82% ========================================== Files 7 2 -5 Lines 77 7 -70 ========================================== - Hits 63 0 -63 + Misses 14 7 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alexdewar commented 3 months ago

@dalonsoa Yep, exactly.

That said, I'm not sure the approach I've followed here is the right one. It seems like putting other projects in random subfolders isn't the way you're "supposed" to do it with cargo. (One consequence of this is that the VS Code Rust extension won't perform auto-complete etc. for the example_code project anymore.)

One option is to use "workspaces", which are basically like subprojects. Then you have a single top-level Cargo.toml file that "includes" the other projects.

Another option would be to move the example code into its own repository.

Of the two, I think I prefer the latter option. The example code won't be changing much (at all?) going forward and it's essentially just in the way at present. We can always signpost it from the documentation, to make sure the current students/future developers can find it as a reference.

What does everyone think? @dalonsoa? @ahawkes?

ahawkes commented 3 months ago

Seems reasonable - we don't need the example code anymore I think - will be working with the "simple model" now. And I guess we can always keep that or something much like it. Btw, I don't get what you mean by "projects" and "workspaces" - I guess I should read up some more on Rust?

dalonsoa commented 3 months ago

Yeah, probably the latter is going to be easier to maintain - or to abandon, if needed.

dalonsoa commented 3 months ago

Created a new repo to move things into:

https://github.com/EnergySystemsModellingLab/highs-example-rust

alexdewar commented 3 months ago

Thanks @dalonsoa. Would you mind making me into an owner for it so I can change some settings? It's also currently private, but I guess we want it to be public?

dalonsoa commented 3 months ago

Done!

alexdewar commented 3 months ago

Superseded by #79.