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

feat: Textile export #808

Merged
merged 106 commits into from
Nov 4, 2024
Merged

feat: Textile export #808

merged 106 commits into from
Nov 4, 2024

Conversation

ccomb
Copy link
Collaborator

@ccomb ccomb commented Oct 17, 2024

🔧 Problem

The processes and materials for textile are a manual json file with copy-pasted impacts. This poses a risk of errors and a lack of traceability.

🍰 Solution

This PR implements an automated textile export similar to the food one, that start from a activities.json file that splits into the final processes.json, processes_impacts.json and material.json and retrieves the impacts from simapro after getting the process names from brightway through a simple search string.

🚨 Points to watch/comments

This implies some refactoring to share code between food and textile (and soon object) and separate pure functions in the common module.
We should also discuss about the resulting impacts changes.

🏝️ How to test

cd data
pipenv run make clean
pipenv run make all

This should start from scratch by deleting the docker volumes, reimport all the databases into brightway, then do the export of food and textile.
At the end, after around 2h of hard work for the machine, you should get an empty git diff and passing tests.
Lasts ~210min on a 2017 notebook...

ecobalyse-private: textile_export

Copy link
Member

@n1k0 n1k0 left a comment

Choose a reason for hiding this comment

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

Just adding a simple isolated comment here as I've not been requested a review.

"primary": activity.get("primary"),
"geographicOrigin": activity["geographicOrigin"],
"defaultCountry": activity["defaultCountry"],
"priority": activity.get("priority"),
Copy link
Member

Choose a reason for hiding this comment

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

This field is never used by anything in the entire codebase it seems, and should be therefore removed entirely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thx! You mean the priority field?
Btw I'll do another PR to do such changes

Copy link
Member

Choose a reason for hiding this comment

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

yes, the priority field

Copy link
Collaborator

@paulboosz paulboosz left a comment

Choose a reason for hiding this comment

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

Significant differences are for :

  • cotton
  • electric mixes

They've been investigated by @ccomb and confirmed to be desirable changes. It looks there was errors in the past values due to copy/pasting.

Gsheet with the differences.

Overview of the differences (at most ~5% diff in total impact)
Screenshot 2024-11-04 at 15 40 34

@ccomb ccomb merged commit b08a789 into master Nov 4, 2024
8 checks passed
@ccomb ccomb deleted the textile_export branch November 4, 2024 14:53
vjousse pushed a commit that referenced this pull request Nov 7, 2024
## [2.5.0](https://github.com/MTES-MCT/ecobalyse/compare/v2.4.0..v2.5.0)
(2024-11-06)



### 🚀 Features

- Add bookmarks for objects
([#781](#781))
- Add object explorer pages.
([#803](#803))
- Distinguish Objects from Veli.
([#813](#813))
- Display score without durability
([#815](#815))
- Textile export
([#808](#808))
- Object export
([#812](#812))

### 🪲 Bug Fixes

- Create object encrypted file for versions
([#800](#800))
- Improve object simulator.
([#799](#799))
- Fix encoded display name field.
([#820](#820))

### 🚜 Refactor

- Aggregate in python
([#794](#794))
- Turn food process category into a list
([#795](#795))
- Aggregate in python
([#807](#807))

### ⚙️ Miscellaneous Tasks

- Upgrade dependencies to their latest version, Oct. 2024.
([#801](#801))
- Add tolerance to tests comparison
([#810](#810))
- *(data)* New export
([#819](#819))

### ◀️ Revert

- "refactor: aggregate in python"
([#806](#806))

<!-- generated by git-cliff -->

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants