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

Resolve scenario calculation bug #1126

Merged
merged 79 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
855ce5f
Delete .github/workflows/install-canary.yaml
marc-vdm Sep 26, 2023
ed2a6f8
Remove unused code in montecarlo.py
marc-vdm Nov 15, 2023
68bd380
Resolve #1103
marc-vdm Nov 15, 2023
7999944
GH action script for commenting on issues when related milestone is c…
marc-vdm Dec 4, 2023
9699278
update bw2io requirement
marc-vdm Sep 17, 2023
69f0a4e
Update readme install instructions
marc-vdm Sep 17, 2023
a7fbd60
Update meta.yaml
marc-vdm Sep 17, 2023
c8fe954
Update README.md
marc-vdm Sep 17, 2023
5cb49c7
Change requirement to brightway2 instead of bw2io
marc-vdm Sep 18, 2023
7da0e5c
Update README.md
bsteubing Sep 25, 2023
a76fd33
Increases the flexibility of the excel importer so it can also handle…
Zoophobus Sep 22, 2023
306d2ff
Update README.md
bsteubing Sep 27, 2023
b2f30cf
Set up signals infrascructure
marc-vdm Sep 22, 2023
7cd8c59
Implement dialog
marc-vdm Sep 23, 2023
8ed34c8
Implement finding of suitable alternatives and proper management of f…
marc-vdm Sep 23, 2023
c666159
Implement actual relinking
marc-vdm Sep 25, 2023
5e97cfa
Minor documentation improvements + store exchanges to remove instead …
marc-vdm Sep 26, 2023
c3972b2
Minor documentation + code improvements
marc-vdm Sep 22, 2023
21b8d8d
Resolve #782 + improve documentation of `Contributions` class
marc-vdm Sep 28, 2023
3ad0ba8
Minor documentation + code improvements
marc-vdm Sep 22, 2023
752bd13
Fix type hinting error
marc-vdm Sep 28, 2023
97ad641
Update README.md
marc-vdm Oct 11, 2023
8854cb6
Update README.md
marc-vdm Oct 11, 2023
1e5fe27
Update README.md
marc-vdm Oct 11, 2023
3852c71
Updates to the functions get_relevant_flows and get_relevant_activiti…
Zoophobus Oct 14, 2023
b6e9c41
Multiple sdf update (#1083)
Zoophobus Oct 20, 2023
92aa40f
Use node16 actions for main pipeline
haasad Oct 29, 2023
909408b
Use node16 actions in release pipeline
haasad Oct 29, 2023
0654b82
Use latest version of release-changelog-builder
haasad Oct 29, 2023
e564225
Use node16 action for install canary pipeline
haasad Oct 29, 2023
ab19c06
Remove the special build for arm architecture
haasad Oct 29, 2023
9addfb8
Install canary updates (#1093)
haasad Oct 30, 2023
2165bb6
Adding error message if no scenario file is loaded in a scenario LCA …
bsteubing Nov 2, 2023
3f1638c
Updated and improved contributing file
marc-vdm Oct 21, 2023
b6879f2
Improve text on dependencies
marc-vdm Oct 21, 2023
fa8ace6
Fix canary link
marc-vdm Oct 21, 2023
4fc7b3b
Add good/bad examples to CONTRIBUTING.md for commit messages and PR t…
marc-vdm Oct 21, 2023
ebf897d
Add more specific requirements on communicating work on issues in CON…
marc-vdm Oct 21, 2023
49b1888
Minor updates to CONTRIBUTING.md and README.md
marc-vdm Oct 23, 2023
2439f55
Minor improvements to CONTRIBUTING.md
marc-vdm Oct 24, 2023
87ab077
Fix formatting error in PULL_REQUEST_TEMPLATE.md
marc-vdm Nov 7, 2023
3480eb5
Resolve #1105
marc-vdm Nov 7, 2023
237b830
Update copyright and license information to only link to one place.
marc-vdm Nov 7, 2023
1d0283a
Resolve 3 bugs for location linking (#1051): 1) database of own activ…
marc-vdm Nov 7, 2023
2b5c713
Improve choosing and handling of alternative locations for location c…
marc-vdm Nov 7, 2023
f9973f2
Resolve readonly database bug for activity duplication to new activity.
marc-vdm Nov 8, 2023
de043cb
Store AB version in logfile
marc-vdm Nov 9, 2023
591c407
Remove deprecated channels from conda envs
haasad Nov 10, 2023
4c0b0d3
Remove experimental conda environment creation and upload
haasad Nov 10, 2023
a377fce
Move conda-envs to .github directory
haasad Nov 10, 2023
8f9f4f7
Move changelog config to .github
haasad Nov 10, 2023
2ffcacd
Move dev recipe to .github directory
haasad Nov 10, 2023
34e0ffa
Move stable recipe to recipe/meta.yaml
haasad Nov 10, 2023
8b5ae43
Update dev recipe
haasad Nov 10, 2023
41c1b27
Use micromamba instead of miniconda to speed up tests
haasad Nov 10, 2023
1c36207
Update install instructions to use libmamba solver with conda
haasad Nov 11, 2023
fb8faac
Fix path for dev recipe
haasad Nov 13, 2023
0a09c46
Added tooltip for table content
mrvisscher Nov 16, 2023
8f6796b
Added docstring for data method
mrvisscher Nov 16, 2023
cd9c891
Cleaning-up documentation
mrvisscher Nov 17, 2023
504a6d8
Update README.md
marc-vdm Nov 22, 2023
94b3295
Add - copy on impact category copy (#1136)
mrvisscher Nov 24, 2023
bd8f748
Resolve bug with switching project on delete (#1138)
mrvisscher Nov 28, 2023
8bf5f8d
Merge branch 'master' of https://github.com/LCA-ActivityBrowser/activ…
marc-vdm Dec 4, 2023
a5628e4
Merge pull request #9 from marc-vdm/auto_point_to_new_release
marc-vdm Dec 4, 2023
6542568
GH action script for commenting on issues when related milestone is c…
marc-vdm Dec 4, 2023
f2afaeb
Merge pull request #10 from marc-vdm/gh_actions
marc-vdm Dec 4, 2023
a836d7c
GH action script for commenting on issues when related milestone is c…
marc-vdm Dec 4, 2023
ab7d30b
Merge pull request #11 from marc-vdm/gh_action2
marc-vdm Dec 4, 2023
96fe93c
GH action script for commenting on issues when related milestone is c…
marc-vdm Dec 4, 2023
5459404
Merge pull request #12 from marc-vdm/gh_action_for_closing_milestones
marc-vdm Dec 4, 2023
400c2d4
review instructions bot
marc-vdm Dec 6, 2023
21e03fb
Merge pull request #14 from marc-vdm/review_message
marc-vdm Dec 6, 2023
3ce5801
review instructions bot
marc-vdm Dec 6, 2023
8b8b041
Merge pull request #16 from marc-vdm/review_message2
marc-vdm Dec 6, 2023
c833778
Merge branch 'master' of https://github.com/LCA-ActivityBrowser/activ…
marc-vdm Dec 6, 2023
ea7cb81
Merge branch 'master' of https://github.com/marc-vdm/activity-browser
marc-vdm Dec 6, 2023
9c1242d
Merge branch 'master' of https://github.com/LCA-ActivityBrowser/activ…
marc-vdm Dec 13, 2023
b0bd785
Merge branch 'master' into scenarios_failing_1103
marc-vdm Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/comment-milestoned-issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: comment when milestone is closed
on:
milestone:
types: [closed]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on issue
uses: actions/github-script@v5
with:
script: |
const milestone_number = context.payload.milestone.number;
const milestone_title = context.payload.milestone.title;

// Get all issues associated with the milestone
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
milestone: milestone_number,
state: 'all',
});

// Loop through the issues and if the issue was closed, post a comment referring to the new release
for (const issue of issues.data) {
if (issue.state === 'closed') {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `This issue has been implemented in the [new release of Activity Browser 🚀 (version ${milestone_title})](https://github.com/LCA-ActivityBrowser/activity-browser/releases/tag/${milestone_title}), you can get the new version by [updating Activity Browser](https://github.com/LCA-ActivityBrowser/activity-browser#updating-the-ab).\n\n_🤖beep boop! I'm a bot and this message was an automated action. If updating does not make sense for this issue, just ignore this._`,
});
}
}
32 changes: 32 additions & 0 deletions .github/workflows/request-review-instructions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: notify reviewer
on:
pull_request:
types: [review_requested]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Comment on PR
uses: actions/github-script@v5
with:
script: |
const pr_number = context.payload.pull_request.number;
const reviewer = context.payload.review.user.login;

const fs = require('fs');
const path = require('path');

// Read CONTRIBUTING.md
const markdown = fs.readFileSync(path.join(process.env.GITHUB_WORKSPACE, '../tree/master/CONTRIBUTING.md'), 'utf8');

// Extract Reviewing guidelines
const section = markdown.split('### Reviewing pull-requests')[1].split('###')[0];

// Post a comment tagging the reviewer asking them to review following the guidelines
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr_number,
body: `> [!NOTE]\n> @${reviewer}, your review was requested for this Pull Request. Please review this PR following these guidelines:\n\n___\n${section}\n\n\n🤖 _beep boop! I'm a bot and this was an automated message._`,
});
15 changes: 0 additions & 15 deletions activity_browser/bwutils/montecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,11 @@ def __init__(self, cs_name):
self.activity_keys = [list(fu.keys())[0] for fu in self.func_units]
self.activity_index = {key: index for index, key in enumerate(self.activity_keys)}
self.rev_activity_index = {index: key for index, key in enumerate(self.activity_keys)}
# previously: self.rev_activity_index = {v: k for k, v in self.activity_keys}
# self.fu_index = {k: i for i, k in enumerate(self.activity_keys)}

# methods
self.methods = self.cs['ia']
self.method_index = {m: i for i, m in enumerate(self.methods)}
self.rev_method_index = {i: m for i, m in enumerate(self.methods)}
# previously: self.rev_method_index = {v: k for k, v in self.method_index.items()}
# self.rev_method_index = {v: k for k, v in self.method_index.items()}

# todo: get rid of the below
self.func_unit_translation_dict = {str(bw.get_activity(list(func_unit.keys())[0])): func_unit
for func_unit in self.func_units}
if len(self.func_unit_translation_dict) != len(self.func_units):
self.func_unit_translation_dict = {}
for fu in self.func_units:
act = bw.get_activity(next(iter(fu)))
self.func_unit_translation_dict["{} {}".format(act, act[0])] = fu
self.func_key_dict = {m: i for i, m in enumerate(self.func_unit_translation_dict.keys())}
self.func_key_list = list(self.func_key_dict.keys())

# GSA calculation variables
self.A_matrices = list()
Expand Down
20 changes: 10 additions & 10 deletions activity_browser/bwutils/multilca.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ def __init__(self, cs_name: str):
self.process_contributions = np.zeros(
(len(self.func_units), len(self.methods), self.lca.technosphere_matrix.shape[0]))

# TODO: get rid of the below
self.func_unit_translation_dict = {
str(bw.get_activity(list(func_unit.keys())[0])): func_unit for func_unit in self.func_units
}
if len(self.func_unit_translation_dict) != len(self.func_units):
self.func_unit_translation_dict = {}
for fu in self.func_units:
act = bw.get_activity(next(iter(fu)))
self.func_unit_translation_dict["{} {}".format(act, act[0])] = fu
name = 'name'
ref_prod = 'reference product'
db = 'database'
self.func_unit_translation_dict = {}
for fu in self.func_units:
key = next(iter(fu))
amt = fu[key]
act = bw.get_activity(key)
self.func_unit_translation_dict[f'{act[name]} | {act[ref_prod]} | {act[db]} | {amt}'] = fu
self.func_key_dict = {m: i for i, m in enumerate(self.func_unit_translation_dict.keys())}
self.func_key_list = list(self.func_key_dict.keys())
self.func_key_list = list(self.func_unit_translation_dict.keys())

def _construct_lca(self):
return bw.LCA(demand=self.func_units_dict, method=self.methods[0])
Expand Down