Generalized Superstructure for recovering rare earth elements from an end-of-life product.#136
Conversation
…ase studies. Superstructures currently exist as python notebooks and the frameworks for the superstructures consider economic and environmental objectives. Superstructures need to be expanded to include more processes for byproduct and iron recovery though.
…e working correctly.
…eralized superstructure function to make comments more clear.
…re skipped if solver is not available.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #136 +/- ##
==========================================
+ Coverage 83.07% 85.46% +2.38%
==========================================
Files 62 67 +5
Lines 7422 8669 +1247
Branches 818 1150 +332
==========================================
+ Hits 6166 7409 +1243
Misses 1078 1078
- Partials 178 182 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…tests and then format code.
agarciadiego
left a comment
There was a problem hiding this comment.
Couple of typo fixing but other than that looks good to me
|
Also please check if you can increase coverage since the code coverage overall is low. @OOAmusat can you help review coverage? |
@agarciadiego This has to do with Gurobi solver not being available on GitHub repository (so the tests are skipped). When I run the tests locally, the code has 100% coverage. |
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
Co-authored-by: agarciadiego <40575271+agarciadiego@users.noreply.github.com>
But we could test a lot of lines of code (i.e., the existence and values of the parameters) without testing the solve. |
… need for solving the model. uses a mock model instead. This should increase code coverage.
The uncovered code was all from the file "report_superstructure_results.py". This function takes in a solved model and outputs the results to the console in a way that is easy for the user to interpret. Since Gurobi is not available on the GitHub repository, all the tests were skipped for this file, leading to poor code coverage. I have added the test file - "test_report_superstructure_results_no_model_solve.py", which tests "report_superstructure_results.py" by making a mock model. This allows full code coverage of "report_superstructure_results.py" without the need for solving the model. The Codecov report now shows that tests fully cover all code. All remaining missing coverage is in the test files (which I don't think Codecov should be including when calculating code coverage). |
Thank you, the coverage looks a lot better |
Addresses Issue:
Summary/Motivation:
The PR introduces a generalized superstructure function that can be used to find the optimal processing pathway for recovering critical minerals from different end-of-life (EOL) products based on user-specified inputs. The user has the option to maximize the net present value (NPV), or minimize the cost of recovery (COR). Additionally, the user can also consider the valorization of byproducts, and the ability to perform multi-objective optimization considering the LCA emission metric of Global Warming Potential.
Changes proposed in this PR:
Reviewer's checklist / merge requirements:
mainbranch on the PR author's forkLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
I agree my contributions are submitted under the license terms described in the LICENSE.md file
at the top level of this directory.
I represent I am authorized to make the contributions and grant the license. If my employer has
rights to intellectual property that includes these contributions, I represent that I have
received permission to make contributions and grant the required license on behalf of that
employer.