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

Lu 231 lca results #218

Merged
merged 432 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
432 commits
Select commit Hold shift + click to select a range
64372b5
Second scrollspace added through a kwarg ('custom') for the inventory…
Athunc Jul 29, 2018
ce799f5
Second scrollspace added through a kwarg ('custom') for the inventory…
Athunc Jul 30, 2018
a16b155
Relative/Absolute button now doesn't reset combobox
Jul 30, 2018
eb32046
Cleaned up Combobox signals
Jul 30, 2018
26cff74
General code improvements
Jul 30, 2018
c2792f4
Functional unit tables and arrays now working as intended.
Jul 30, 2018
30d8cbf
MiniMap functional
Jul 30, 2018
9693722
MiniMap functional
Jul 30, 2018
ec73529
Added the beginnings of the Biosphere inventory Table
Athunc Jul 30, 2018
c07e790
Clean up of code
Jul 30, 2018
6d39c0b
Made the custom kwarg update the second table
Athunc Jul 30, 2018
b945cad
Merge remote-tracking branch 'origin/Results_Analysis' into Results_A…
Athunc Jul 30, 2018
9c66ecf
Scrollbar management for custom tab improved. Will need to limit tabl…
Athunc Jul 30, 2018
8be218e
The Layout now actually allows a second header and table to be seen.
Athunc Jul 30, 2018
4342643
Making a new class for the Biesphere Inventory Table
Athunc Jul 30, 2018
9eb29b8
Making a new class for the Biosphere Inventory Table
Athunc Jul 30, 2018
b5eab8d
Removed some wayward print statements
Athunc Jul 30, 2018
04c5933
Passing an amount to scale the edges
bsteubing Jul 30, 2018
481b722
Table constructor made for Biosphere matrix
Athunc Jul 30, 2018
a0141bb
Biosphere matrix is now cut to size and displayed, but it appears tha…
Athunc Jul 30, 2018
1c3ddfa
Problem with all-zeros persists, searches on the internet have yielde…
Athunc Jul 30, 2018
b5034e2
Reordering the Inventory data for table along with labels
Athunc Jul 30, 2018
33dfd63
The data in the inventory table is finally ordered from large to smal…
Athunc Jul 30, 2018
dbd2f9d
Added a minimum_width to the Biosphere Table
Athunc Jul 30, 2018
7681080
Set the minimum-sizes for the Biosphere Table and its Widget, automat…
Athunc Jul 30, 2018
1f92eea
The functional units ComboBox now functions correctly. I have made a …
Athunc Jul 30, 2018
3280d2e
Eradicated some more key-errors caused by arguments being passed to w…
Athunc Jul 30, 2018
8e51f5d
The heat-map can now also be set to relative or absolute through a bu…
Athunc Jul 30, 2018
1268bd8
Relative/absolute option now functions on all relevant tables and gra…
Athunc Jul 30, 2018
76d203f
refactoring ActivityDetailsTab class: beginning
Jul 31, 2018
0401a22
promote contents of get_details_widget() out of unnecessary method
Jul 31, 2018
f40a2f1
move read-only checkbox to above activity data
Jul 31, 2018
69b5270
toward handling read-only / editable activities
Jul 31, 2018
d3167ad
Added totals to tables when relevant, changed switching buttons to be…
Jul 31, 2018
8ef139b
Relative/absolute option now functions on all relevant tables and gra…
Athunc Jul 31, 2018
71ebc32
Merge remote-tracking branch 'origin/Results_Analysis' into Results_A…
Athunc Jul 31, 2018
8f79682
rename ActivityDetailsTab to ActivityTab
Jul 31, 2018
38ebf97
Added radiobuttons (no logic), reverted Totals logic.
Jul 31, 2018
9e5ca3d
Merge remote-tracking branch 'origin/Results_Analysis' into Results_A…
Jul 31, 2018
ff3cd15
Changes while in meeting with Bernhard
Athunc Jul 31, 2018
f457959
Merge remote-tracking branch 'origin/Results_Analysis' into Results_A…
Athunc Jul 31, 2018
31d3e3a
Updated TODO list
Athunc Jul 31, 2018
1b54e70
Simplified some of the coding
Athunc Jul 31, 2018
69bfcf5
Simplified some of the coding
Athunc Jul 31, 2018
79e88a4
Moved making top_contributions dict to function
Jul 31, 2018
f86f082
Merge remote-tracking branch 'origin/Results_Analysis' into Results_A…
Jul 31, 2018
3727614
set_exchange_tables_read_only function improved
Jul 31, 2018
e7050c2
Merge branch 'appdirs' of https://github.com/LCA-ActivityBrowser/acti…
Aug 1, 2018
fe80749
working functionality: read-only status of relevant open activities u…
Aug 1, 2018
61d426b
toward properly enabling and disabling the read-only activity checkbox
Aug 1, 2018
122b2ec
toward user_project_settings()
Aug 1, 2018
477e2ce
user project settings files seemingly functional
Aug 2, 2018
0aa92c8
rename readOnlyStateChanged to read_only_changed
Aug 2, 2018
709f19d
modify class ActivityTab to inherit from QTabWidget rather than QWidget
Aug 2, 2018
ee9a203
refactor: delete some signals and better read_only property handling
Aug 2, 2018
b8445d7
reduce whitespace on activity tab
Aug 2, 2018
33b9544
remove empty legacy function
Aug 2, 2018
b5f08a9
refactor for consistency: only use term 'read_only' throughout code
Aug 2, 2018
cfbe026
improve duplicate activities to other databases from inventory context:
Aug 2, 2018
c04ab47
toward duplicating activity to databases with dropdown
Aug 2, 2018
e69d39c
dropdown menu to duplicate activity to other database working
Aug 3, 2018
73d2765
New Sankey widget and improvements on GraphNavigator
bsteubing Aug 3, 2018
f40b5da
New Sankey Widget is now linked to Calculation Setups.
bsteubing Aug 3, 2018
36be397
Change 'Read Only' checkbox to 'Edit Activity' checkbox
Aug 6, 2018
ab68567
some amends as requested in feedback on PR:
Aug 6, 2018
84fe5ca
remove unused imports and organise them
Aug 7, 2018
ea6c6d1
Disabled re-calculation of Sankey at click on Sankey Tab; added TODOs
bsteubing Aug 8, 2018
f0f88bd
Added percentages for edges in Sankey
bsteubing Aug 9, 2018
6085d92
Change node fill based on impact
bsteubing Aug 9, 2018
6f08363
GraphNav: change arrow direction based on sign of flow amount
bsteubing Aug 9, 2018
51947ab
Better output; Node hover; better color scale;
bsteubing Aug 9, 2018
99aa686
Still better output
bsteubing Aug 10, 2018
8038f27
Enabling "flip negative flows"; Adding tooltips.
bsteubing Aug 15, 2018
e3f88d3
Adding back/forward icons and some status bar output.
bsteubing Aug 15, 2018
f1324b9
Merge branch 'Results_Analysis' of https://github.com/LU-CML/activity…
Athunc Aug 30, 2018
fbeb8e9
Made the radio buttons for relative/absolute functional.
Athunc Aug 30, 2018
a2f06b8
add confirmation box to check if user wants to duplicate activity
Aug 31, 2018
e16e693
fix issue where activities context menu was disabled on first opening…
Aug 31, 2018
668f6eb
fix bug where activityTab properties could be out of sync with databa…
Aug 31, 2018
e959839
Merge branch 'master' into redesign_act_tab
tmillross Aug 31, 2018
9774c0b
Merge branch 'redesign_act_tab' of github.com:TMillross/activity-brow…
Aug 31, 2018
c56d5a1
Working to replace the functional unit/ assessment method button into…
Athunc Aug 31, 2018
b56b464
Replaced the functional unit/ assessment method button with radio but…
Athunc Aug 31, 2018
8d4b510
Implemented some bug-fixes for the Combobox_options radio buttons
Athunc Aug 31, 2018
b08fdf7
Cleaned up some of the debugging-lines
Athunc Aug 31, 2018
150675a
The options for comparing LCIA Methods or comparing Functional units …
Athunc Sep 5, 2018
c893364
Removed the "No cutoff" radio button
Athunc Sep 5, 2018
57a6f22
Placed the cutoff slider, its minimum value and its maximum value in …
Athunc Sep 5, 2018
b42b7ab
Removed the grid-lines from the LCA results bar chart, finally.
Athunc Sep 5, 2018
5241fa5
remove red border-line from top of locked activities due to aesthetic…
Sep 8, 2018
89e6dd6
update activity database dropdown list on db_read_only_changed so act…
Sep 8, 2018
638ca9d
add location list combo to activity tab
Sep 27, 2018
36b1b25
add documentation and suggested improvements to activity_browser/app/…
Sep 28, 2018
a1aedfd
Changed bar-chart labels to 'pnl'-style format
Athunc Oct 2, 2018
8e9b840
cleaned the code up a bit and made a start with expanding the invento…
Athunc Oct 2, 2018
a0c0619
Expanded the inventory table to show data for all functional units si…
Athunc Oct 2, 2018
9524c67
First complete version of the Inventory table. The export of this tab…
Athunc Oct 3, 2018
21c56bb
Removed the unneeded combobox on the Inventory tab.
Athunc Oct 3, 2018
8935679
This version is ready to be merged with the master branch.
Athunc Oct 3, 2018
49e6485
ready for code-review and discussion with Bernhard
Oct 8, 2018
a3bafac
Merge branch 'master' into redesign_act_tab
tmillross Oct 8, 2018
d6408ea
delete merge conflict tag
Oct 8, 2018
7ef048a
Merge pull request #200 from tmillross/redesign_act_tab
bsteubing Oct 18, 2018
d613f87
Merge pull request #203 from LU-CML/graph_navigator_towards_contribut…
bsteubing Oct 18, 2018
cb9ebfd
Merge pull request #202 from LU-CML/Results_Analysis
bsteubing Oct 18, 2018
789689a
Merge branch 'changes_LU_2' into LU_23
bsteubing Oct 18, 2018
c375059
Merge branch 'changes_LU_1' into LU_231
bsteubing Oct 18, 2018
b52f701
Improved Characterization Factor tab
bsteubing Oct 18, 2018
a2513f0
Cleaning up Results Analysis
bsteubing Oct 18, 2018
d87d340
Cleaning up Results Analysis...
bsteubing Oct 18, 2018
fd6f262
deleting old LCA_Results_tab
bsteubing Oct 18, 2018
05453de
improving the results analysis
bsteubing Oct 22, 2018
c65e30c
Separated cutoff menu from AnalysisTab
bsteubing Oct 22, 2018
675367c
Some corrections to the previous commit
bsteubing Oct 22, 2018
64e3399
Relocating cutoff value and type entirely into CutoffMenu
bsteubing Oct 22, 2018
0ff7bc4
Relocating the Sankey Navigator in the LCA Results tab
bsteubing Oct 22, 2018
11f48da
Tools menu including Show/hide history tab
bsteubing Oct 25, 2018
7436fff
Towards a simplified show/hide behaviour of tabs in the left-right pa…
bsteubing Oct 25, 2018
a9b007a
Simplifying open_activity_tab signal
bsteubing Oct 25, 2018
6aeec84
several improvements, but now an unexpected import error
bsteubing Oct 25, 2018
9a0b7ca
fixed the issue, which was related to a circular import
bsteubing Oct 25, 2018
8c146ec
Closing activity, method, and LCA result tabs when empty works, but i…
bsteubing Oct 25, 2018
1dbe3c7
CF_tab, ActivitiesTab, and LCA_results tabs now all use the tabs dict…
bsteubing Oct 25, 2018
7c2138b
Opening, closing, and selecting behaviour of tabs works fine now. Cod…
bsteubing Oct 25, 2018
cee9962
GraphExplorer can now be started from context menu of activities (pro…
bsteubing Oct 26, 2018
28158e5
Finally solved the GraphNavigator page loading problem with the signa…
bsteubing Oct 26, 2018
52485ab
Add open graph functionality to activity tabs
bsteubing Oct 26, 2018
b2464bf
Changed order of columns in databases table
bsteubing Oct 26, 2018
861a449
Improving spacing in GraphExplorer
bsteubing Oct 27, 2018
be3a86b
Improving Sankey Navigator
bsteubing Oct 27, 2018
b1901e1
small cleanup before next task
bsteubing Oct 27, 2018
b7d3311
Set app default font
bsteubing Oct 27, 2018
08f89f6
Some smaller changes, mostly nomenclature
bsteubing Oct 28, 2018
fc158b0
Introduction of convenience data, i.e. data across databases, which m…
bsteubing Oct 28, 2018
6d3a863
Towards an implementation of the previous (further work needed, e.g. …
bsteubing Oct 28, 2018
c281cb4
Small bugfix; some naming changes;
bsteubing Oct 29, 2018
0e6c06c
Added signals for databases update when activities are added/deleted
bsteubing Oct 29, 2018
dd5303c
Descriptions and sections for controller and bwutils
bsteubing Oct 29, 2018
2250beb
Better spacing in activity tab due to relocation of description to to…
bsteubing Oct 29, 2018
f34c5c0
Reordering the inventory table; plus some smaller changes
bsteubing Oct 29, 2018
1ba18d9
Limit columns width for certain tables (for now: ActivitiesTable)
bsteubing Oct 29, 2018
1b42913
Units and products can now be edited... however, this needs to be sub…
bsteubing Oct 29, 2018
30dad92
Fixed color cycling issue and grid lines in LCA results plot
bsteubing Oct 30, 2018
2eb6570
Minor changes
bsteubing Oct 30, 2018
137fe9f
Using verticalHeader().setDefaultSectionSize(22) instead of resizeRow…
bsteubing Nov 2, 2018
b21d60d
Included inventory table again, but this still needs work
bsteubing Nov 2, 2018
c133eb6
Sort and copy methods for the LCA Results tables
bsteubing Nov 5, 2018
e364bac
A working version of the inventory table (tables still need a general…
bsteubing Nov 7, 2018
8a64bab
Improve saving of tables
bsteubing Nov 7, 2018
2badb47
Elementary flow and process contribution tables work, but the latter …
bsteubing Nov 7, 2018
967b8c5
Merge branch 'master' into LU_231
bsteubing Feb 22, 2019
31b5a5f
bugfix: drag and drop was working also in activities in non-edit mode
bsteubing Feb 26, 2019
e3260a4
Inventory tab is only generated on click
bsteubing Feb 26, 2019
55001ec
superficially removed the old Sankey diagram
bsteubing Feb 26, 2019
632a01e
Merge branch 'master' into LU_231
bsteubing Feb 26, 2019
7be05d2
Got working inventory tables (biosphere and technosphere) now
bsteubing Feb 26, 2019
998a60f
Corrected EF and process contributions
bsteubing Feb 26, 2019
f9c54de
Fixing Mac font size and start of multilca overhaul
bsteubing Feb 28, 2019
8c94d73
bugfix contribution analysis
bsteubing Feb 28, 2019
f5b01da
towards a better Contribution Analysis and LCA Results
bsteubing Mar 1, 2019
73441a3
EF and process contributions now relate to the new Contribution Analy…
bsteubing Mar 1, 2019
2bbfd12
Inventory also based on metadata df, but is for some reason still slo…
bsteubing Mar 1, 2019
832f455
Metadata in LCA Results now works and is fast (but still needs to be …
bsteubing Mar 3, 2019
d614585
Contribution tables now show metadata
bsteubing Mar 3, 2019
2b79f62
Contribution tables now show metadata
bsteubing Mar 3, 2019
976536e
minor improvements
bsteubing Mar 3, 2019
8f63087
Inventory Tab based on new parent class and some other changes
bsteubing Mar 3, 2019
c6aa8b1
LCA scores tab based on new parent class
bsteubing Mar 3, 2019
de52049
Cosmetic changes
bsteubing Mar 3, 2019
d1e2fda
Better save file names
bsteubing Mar 3, 2019
1b270a4
First version of metadata store is working
bsteubing Mar 4, 2019
618627c
New Activity/Biosphere tables in project manager
bsteubing Mar 4, 2019
afcb0ba
Small step to updating metadata
bsteubing Mar 4, 2019
2a5912f
Drag works, but drop not yet
bsteubing Mar 4, 2019
914dde5
Drag and drop works from new ActivityBiosphere/Inventory tables.
bsteubing Mar 4, 2019
53259f0
Metadata updates work, but are still buggy...
bsteubing Mar 4, 2019
ce49527
Updating metadata seems to work now (if e.g. activities are added, mo…
bsteubing Mar 5, 2019
b293aea
Search is working over all metadata fields and is fast!!
bsteubing Mar 5, 2019
5b395aa
Cosmetic changes
bsteubing Mar 5, 2019
2770de1
Cleaned up and got correct sizing of tables
bsteubing Mar 5, 2019
969aa08
Drag and drop works for CalculationSetup
bsteubing Mar 5, 2019
3b72d6e
More table sizing and fixing that exchanges can be deleted from any f…
bsteubing Mar 5, 2019
e0364aa
Deleting works also from all biosphere exchange fields
bsteubing Mar 5, 2019
c5ab654
Fixed some smaller bugs
bsteubing Mar 6, 2019
4cc41f7
Reversed the colormap for the LCA results overview plot
bsteubing Mar 6, 2019
774a8ca
First version of a MonteCarlo LCA
bsteubing Mar 6, 2019
8a683d2
Big commit introducing a CS based MonteCarloLCA
bsteubing Mar 7, 2019
19c1252
A few small improvements
bsteubing Mar 8, 2019
13447ae
Tried threading for Monte Carlo simulation... but pyparadiso crashing…
bsteubing Mar 8, 2019
b35e60f
Added medians to MC plot
bsteubing Mar 8, 2019
d017763
LCA results in one tabe; generic method to get headers and radio butt…
bsteubing Mar 8, 2019
07d6711
Small stuff like figure height adjustment
bsteubing Mar 8, 2019
b7848d8
Small stuff like figure height adjustment
bsteubing Mar 8, 2019
856d5dc
adapted tests; work now at least on Windows
bsteubing Mar 9, 2019
e7a76b2
bumping version
bsteubing Mar 9, 2019
4bcc5e5
Moved welcome screen to larger right side
bsteubing Mar 10, 2019
3fdb6ab
Better output file naming for LCA results tabs
bsteubing Mar 10, 2019
fa59d4e
Adding units to contribution plots
bsteubing Mar 10, 2019
b475276
LCA results now don't update anymore, but simply recalculate, which e…
bsteubing Mar 10, 2019
b682b7d
LCA results now don't update anymore, but simply recalculate, which e…
bsteubing Mar 10, 2019
ff147bc
Update of welcome tab
bsteubing Mar 10, 2019
47358c3
Add requirements for pandas >= 0.24.1
bsteubing Mar 11, 2019
afb72fd
Improved the welcome screen
bsteubing Mar 11, 2019
f352b67
Update of welcome tab
bsteubing Mar 12, 2019
5f09926
Merge branch 'LU_231_LCA_results' of https://github.com/LCA-ActivityB…
bsteubing Mar 12, 2019
523f536
Fixing the svg problem on mac
bsteubing Mar 12, 2019
8226fff
Fixing the black background in graph navigator / sankey?
bsteubing Mar 12, 2019
2934545
Sort indicator in ActivitiesBiosphereTable now shows correct sort column
bsteubing Mar 12, 2019
524e422
added networkx dependency
bsteubing Mar 13, 2019
40f52bc
fixed bad character in meta.yaml
bsteubing Mar 13, 2019
890d824
Updated image in readme.md
bsteubing Mar 13, 2019
2339630
changed to py=3.7 in yaml files
bsteubing Mar 15, 2019
c391556
new yaml file
bsteubing Mar 15, 2019
08a03de
more yaml
bsteubing Mar 15, 2019
67353c6
more yaml
bsteubing Mar 15, 2019
284605f
more yaml
bsteubing Mar 15, 2019
1b496a0
more yaml
bsteubing Mar 15, 2019
4b6f2f3
more yaml
bsteubing Mar 15, 2019
6235f43
more yaml
bsteubing Mar 18, 2019
db599f2
more yaml
bsteubing Mar 18, 2019
13372f5
more yaml - without testing
bsteubing Mar 18, 2019
6074eca
more yaml - without testing
bsteubing Mar 21, 2019
f75559c
more yaml
bsteubing Mar 22, 2019
848147f
more yaml
bsteubing Mar 22, 2019
7e172d8
more yaml
bsteubing Mar 22, 2019
88b4608
more yaml
bsteubing Mar 22, 2019
b2907d5
more yaml
bsteubing Mar 22, 2019
6ea69df
more yaml
bsteubing Mar 22, 2019
9ae1d3e
more yaml
bsteubing Mar 22, 2019
42eb5bc
conda_build.sh
bsteubing Mar 22, 2019
ba4be43
conda_build.sh
bsteubing Mar 22, 2019
23e4c9f
conda_build.sh
bsteubing Mar 22, 2019
3bb9a5d
travis
bsteubing Mar 22, 2019
34cfc93
travis
bsteubing Mar 22, 2019
ab835b2
conda upload script
bsteubing Mar 22, 2019
a7b507c
conda upload script
bsteubing Mar 22, 2019
af7f33a
webhook for travis
bsteubing Mar 22, 2019
1af64fb
webhook for travis
bsteubing Mar 22, 2019
39b3088
webhook for travis
bsteubing Mar 22, 2019
95f8e31
temporarily removing conda_upload.sh
bsteubing Mar 22, 2019
2e2b9c3
trying to get travis to do something on build
bsteubing Mar 22, 2019
98d9b0b
trying to get travis to do something on build
bsteubing Mar 22, 2019
1631483
working on travis.yml
bsteubing Mar 22, 2019
65ece8a
getting travis AND appveyor to work
bsteubing Mar 22, 2019
9df04d6
getting travis AND appveyor to work
bsteubing Mar 22, 2019
7c90141
getting travis AND appveyor to work
bsteubing Mar 22, 2019
9884387
getting travis AND appveyor to work
bsteubing Mar 22, 2019
2ce5ff0
getting travis AND appveyor to work
bsteubing Mar 22, 2019
051af89
final sprint on the build process
bsteubing Mar 22, 2019
9823a08
more yaml - without testing
bsteubing Mar 22, 2019
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Makefile
.DS_Store
.cache
.pytest_cache
activity_browser/ABSettings.json
*.bak
/.idea
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ matrix:
- python: "3.6"
os: linux

- python: "3.6"
- python: "3.7"
language: generic-covered
os: osx
env: pyver=3.6 pydist=macpython
env: pyver=3.7 pydist=macpython

before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get update;
fi


install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Running on OS X"; else echo "Running on Linux"; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
Expand Down Expand Up @@ -54,7 +55,7 @@ install:
- source activate test-environment
- conda install -q --use-local activity-browser-dev
- conda install -q 'pytest<3.5' pytest-qt pytest-mock
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
conda install -q "pytest-cov<2.6" python-coveralls;
fi

Expand All @@ -74,24 +75,23 @@ script:
else
py.test;
fi

after_success:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
coveralls;
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
conda install anaconda-client;
cp /home/travis/miniconda/conda-bld/noarch/*.tar.bz2 .;
anaconda -t $CONDA_TOKEN upload --force *.tar.bz2;
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
conda install conda-build anaconda-client conda-verify;
bash ci/conda_upload.sh;
echo "uploaded to conda channel";
else
echo "no upload because not master branch";
fi
else
echo "no upload from osx";
fi


notifications:
email:
on_success: always # default: change
on_failure: always # default: always
on_failure: always # default: always
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[![Anaconda-Server Badge](https://anaconda.org/haasad/activity-browser/badges/version.svg)](https://anaconda.org/haasad/activity-browser) [![Anaconda-Server Badge](https://anaconda.org/haasad/activity-browser/badges/downloads.svg)](https://anaconda.org/haasad/activity-browser)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![linux](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/linux.png)![apple](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/apple.png)[![Build Status](https://travis-ci.org/LCA-ActivityBrowser/activity-browser.svg?branch=master)](https://travis-ci.org/LCA-ActivityBrowser/activity-browser)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![windows](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/windows.png)[![Build status](https://ci.appveyor.com/api/projects/status/8cljoh7o1jrof8tf/branch/master?svg=true)](https://ci.appveyor.com/project/haasad/activity-browser/branch/master)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![Coverage Status](https://coveralls.io/repos/github/LCA-ActivityBrowser/activity-browser/badge.svg?branch=master)](https://coveralls.io/github/LCA-ActivityBrowser/activity-browser?branch=master)
[![Anaconda-Server Badge](https://anaconda.org/bsteubing/activity-browser/badges/version.svg)](https://anaconda.org/bsteubing/activity-browser) [![Anaconda-Server Badge](https://anaconda.org/bsteubing/activity-browser/badges/downloads.svg)](https://anaconda.org/bsteubing/activity-browser)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![linux](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/linux.png)![apple](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/apple.png)[![Build Status](https://travis-ci.org/LCA-ActivityBrowser/activity-browser.svg?branch=master)](https://travis-ci.org/LCA-ActivityBrowser/activity-browser)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![windows](https://raw.githubusercontent.com/vorillaz/devicons/master/!PNG/windows.png)[![Build status](https://ci.appveyor.com/api/projects/status/8cljoh7o1jrof8tf/branch/master?svg=true)](https://ci.appveyor.com/project/haasad/activity-browser/branch/master)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![Coverage Status](https://coveralls.io/repos/github/LCA-ActivityBrowser/activity-browser/badge.svg?branch=master)](https://coveralls.io/github/LCA-ActivityBrowser/activity-browser?branch=master)



# Activity Browser - a GUI for Brightway2

<img src="https://user-images.githubusercontent.com/11636405/33426133-156c61ce-d5c1-11e7-8017-2a5763a5b265.png" width="250"/><img src="https://user-images.githubusercontent.com/11636405/33426139-1d1ca7a8-d5c1-11e7-819b-c4ceb2da310a.png" width="250"/><img src="https://user-images.githubusercontent.com/11636405/33426144-1fe288e0-d5c1-11e7-825f-9aedd64071b0.png" width="250"/>
<img src="https://user-images.githubusercontent.com/33026150/54299977-47a9f680-45bc-11e9-81c6-b99462f84d0b.png" width=100%/>

The activity browser is a graphical user interface for the [Brightway2](https://brightwaylca.org) advanced life cycle assessment framework.

Expand Down Expand Up @@ -120,10 +120,11 @@ __Brightway2__:


## Copyright

Copyright (c) 2015, Bernhard Steubing and ETH Zurich
Copyright (c) 2017-2019, Bernhard Steubing (Leiden University), Adrian Haas (ETH Zurich)
Copyright (c) 2016, Chris Mutel and Paul Scherrer Institut
Copyright (c) 2017-2018, Adrian Haas (ETH Zurich) and Bernhard Steubing (Leiden University)
Copyright (c) 2015, Bernhard Steubing and ETH Zurich



This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Empty file added __init__.py
Empty file.
5 changes: 4 additions & 1 deletion activity_browser/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
import sys
import traceback

from PyQt5 import QtWidgets
from PyQt5 import QtWidgets, QtCore

from .application import Application
from .ui.style import default_font


def run_activity_browser():
qapp = QtWidgets.QApplication(sys.argv)
# qapp.setFont(default_font)
application = Application()
application.show()
print("PyQt Version:", QtCore.PYQT_VERSION_STR)

def exception_hook(*args):
print(''.join(traceback.format_exception(*args)))
Expand Down
6 changes: 6 additions & 0 deletions activity_browser/app/bwutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# -*- coding: utf-8 -*-
"""
bwutils is a collection of methods that build upon brightway2 and are generic enough to provide here so that we avoid
re-typing the same code in different parts of the Activity Browser.
"""

from .data import convenience_data
146 changes: 120 additions & 26 deletions activity_browser/app/bwutils/commontasks.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# -*- coding: utf-8 -*-
import textwrap

import arrow
import brightway2 as bw
from bw2data.utils import natural_sort
from bw2data import databases
from bw2data.utils import natural_sort

from ..settings import ab_settings, project_settings

from ..settings import ab_settings
"""
bwutils is a collection of methods that build upon brightway2 and are generic enough to provide here so that we avoid
re-typing the same code in different parts of the Activity Browser.

When adding new methods, please use the sections below (or add a new section, if required).
"""


# Formatting
def wrap_text(string, max_length=80):
"""wrap the label making sure that key and name are in 2 rows"""
# idea from https://stackoverflow.com/a/39134215/4929813
Expand All @@ -17,37 +24,36 @@ def wrap_text(string, max_length=80):
return '\n'.join([fold(line, wrapArgs) for line in string.splitlines()])


def format_activity_label(act, style='pnl', max_length=40):
def format_activity_label(key, style='pnl', max_length=40):
try:
a = bw.get_activity(act)
act = bw.get_activity(key)

if style == 'pnl':
label = wrap_text(
'\n'.join([a.get('reference product', ''), a.get('name', ''),
str(a.get('location', ''))]), max_length=max_length)
label = '\n'.join([act.get('reference product', ''), act.get('name', ''),
str(act.get('location', ''))])
elif style == 'pnl_':
label = ' | '.join([act.get('reference product', ''), act.get('name', ''),
str(act.get('location', ''))])
elif style == 'pl':
label = wrap_text(', '.join([a.get('reference product', '') or a.get('name', ''),
str(a.get('location', '')),
]), max_length=40)
label = ', '.join([act.get('reference product', '') or act.get('name', ''),
str(act.get('location', '')),])
elif style == 'key':
label = wrap_text(str(a.key)) # safer to use key, code does not always exist
label = str(act.key) # safer to use key, code does not always exist

elif style == 'bio':
label = wrap_text(',\n'.join(
[a.get('name', ''), str(a.get('categories', ''))]), max_length=30
)
label = ',\n'.join([act.get('name', ''), str(act.get('categories', ''))])
else:
label = wrap_text(
'\n'.join([a.get('reference product', ''), a.get('name', ''),
str(a.get('location', ''))]))
label = '\n'.join([act.get('reference product', ''), act.get('name', ''),
str(act.get('location', ''))])
except:
if isinstance(act, tuple):
return wrap_text(str(''.join(act)))
if isinstance(key, tuple):
return wrap_text(str(''.join(key)))
else:
return wrap_text(str(act))
return label
return wrap_text(str(key))
return wrap_text(label, max_length=max_length)


# Database
def get_database_metadata(name):
""" Returns a dictionary with database meta-information. """
d = dict()
Expand All @@ -68,6 +74,45 @@ def get_databases_data(databases):
yield data


def get_editable_databases():
editable_dbs = []
databases_read_only_settings = project_settings.settings.get('read-only-databases', {})
for db_name, read_only in databases_read_only_settings.items():
if not read_only and db_name != 'biosphere3':
editable_dbs.append(db_name)
return editable_dbs


def is_database_read_only(db_name):
if "read-only-databases" in project_settings.settings:
return project_settings.settings["read-only-databases"].get(db_name, True)


def is_technosphere_db(db_name):
"""Returns True if database describes the technosphere, False if it describes a biosphere."""
if not db_name in bw.databases:
raise KeyError('Not an existing database:', db_name)
db = bw.Database(db_name)
act = db.random()
if act.get('type', 'process') == "process":
return True
else:
return False


# Activity
AB_names_to_bw_keys = {
"Amount": "amount",
"Product": "reference product",
"Activity": "name",
"Unit": "unit",
"Location": "location",
"Database": "database",
"Uncertainty": "uncertainty type",
}

bw_keys_to_AB_names = {v: k for k, v in AB_names_to_bw_keys.items()}

def get_activity_data(datasets):
# if not fields:
# fields = ["name", "reference product", "amount", "location", "unit", "database"]
Expand All @@ -82,13 +127,46 @@ def get_activity_data(datasets):
'Location': ds.get('location', 'unknown'),
# 'Amount': "{:.4g}".format(key['amount']),
'Unit': ds.get('unit', 'unknown'),
'Database': ds['database'],
'Database': ds.get(['database'], 'unknown'),
'Uncertain': "True" if ds.get("uncertainty type", 0) > 1 else "False",
'key': ds,
}
yield obj


def get_activity_name(key, str_length=22):
return ','.join(key.get('name', '').split(',')[:3])[:str_length]


def get_activity_data_as_lists(act_keys, keys=None):
results = dict()
for key in keys:
results[key] = []

for act_key in act_keys:
act = bw.get_activity(act_key)
for key in keys:
results[key].append(act.get(key, 'Unknown'))

return results


def identify_activity_type(activity):
"""Return the activity type based on its naming."""
name = activity["name"]
if "treatment of" in name:
return "treatment"
elif "market for" in name:
# if not "to generic" in name: # these are not markets, but also transferring activities
return "market"
elif "market group" in name:
# if not "to generic" in name:
return "marketgroup"
else:
return "production"


# Exchanges
def get_exchanges_data(exchanges):
# TODO: not finished
results = []
Expand All @@ -98,6 +176,7 @@ def get_exchanges_data(exchanges):
print(r)


# Settings (directory, project, etc.)
def get_startup_bw_dir():
"""Returns the brightway directory as defined in the settings file.
If it has not been defined here, it returns the brightway default directory."""
Expand Down Expand Up @@ -132,10 +211,25 @@ def get_default_project_name():
else:
return None


# LCIA
def unit_of_method(method):
assert method in bw.methods
return bw.methods[method].get('unit')

def get_LCIA_method_name_dict(keys):
"""LCIA methods in brightway2 are stored in tuples, which is unpractical for display in, e.g. dropdown Menues.
Returns a dictionary with
key: comma separated string
value: brightway2 method tuple
keys: comma separated strings
values: brightway2 method tuples
"""
return {', '.join(key): key for key in keys}
return {', '.join(key): key for key in keys}


#
# def get_locations_in_db(db_name):
# """returns the set of locations in a database"""
# db = bw.Database(db_name)
# loc_set = set()
# [loc_set.add(act.get("location")) for act in db]
# return loc_set
37 changes: 37 additions & 0 deletions activity_browser/app/bwutils/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
import brightway2 as bw

from ..signals import signals


class ConvenienceData(object):
"""Stores data that may be re-used within one session, e.g.:
- sets of locations and units that occur with in different databases."""
def __init__(self):
self.data = dict()

self.connect_signals()

def connect_signals(self):
signals.edit_activity.connect(self.get_convenience_data)

def get_convenience_data(self, db_name, update=False):
"""Get data from activities across one database and store it in sets."""
if not db_name in self.data or update:
locations = set()
units = set()
for act in bw.Database(db_name):
locations.add(act.get("location"))
units.add(act.get("unit"))

self.data[db_name] = {
"locations": locations,
"units": units,
}
print("{} unique locations and {} unique units in {}".format(
len(self.data[db_name]["locations"]),
len(self.data[db_name]["units"]),
db_name))


convenience_data = ConvenienceData()
Loading