brightway-basic-explorer 0.9.dev1__tar.gz → 0.9.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (15) hide show
  1. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/PKG-INFO +2 -1
  2. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer/__init__.py +25 -7
  3. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer.egg-info/PKG-INFO +2 -1
  4. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer.egg-info/SOURCES.txt +1 -0
  5. brightway_basic_explorer-0.9.dev2/brightway_basic_explorer.egg-info/requires.txt +1 -0
  6. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/pyproject.toml +2 -2
  7. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/COPYING +0 -0
  8. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/README.md +0 -0
  9. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer/icons/emission.png +0 -0
  10. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer/icons/natural_resource.png +0 -0
  11. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer/icons/process.png +0 -0
  12. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer/icons/unknown.png +0 -0
  13. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer.egg-info/dependency_links.txt +0 -0
  14. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/brightway_basic_explorer.egg-info/top_level.txt +0 -0
  15. {brightway_basic_explorer-0.9.dev1 → brightway_basic_explorer-0.9.dev2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brightway-basic-explorer
3
- Version: 0.9.dev1
3
+ Version: 0.9.dev2
4
4
  Summary: Implement basic GUI to explorer brightway ativities
5
5
  Author-email: Benoît GSCHWIND <benoit.gschwind@minesparis.psl.eu>, OIE - Mines Paris PSL <benoit.gschwind@minesparis.psl.eu>
6
6
  Maintainer-email: Benoît GSCHWIND <benoit.gschwind@minesparis.psl.eu>
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: COPYING
19
+ Requires-Dist: ipython
19
20
  Dynamic: license-file
20
21
 
21
22
  # Brightway Basic Explorer
@@ -4,7 +4,7 @@ from IPython.external.qt_for_kernel import QtGui, QtCore
4
4
  from IPython.lib.guisupport import start_event_loop_qt4, get_app_qt4, is_event_loop_running_qt4
5
5
 
6
6
  import os
7
- import matplotlib
7
+ import sys
8
8
  import bw2data
9
9
 
10
10
  def activity_to_json(act):
@@ -49,7 +49,7 @@ class TableModel(QtGui.QStandardItemModel):
49
49
  etype = e.get("type", "unknown")
50
50
  if etype == "emission":
51
51
  path = os.path.join(os.path.dirname(__file__), "icons", "emission.png")
52
- elif etype == "process":
52
+ elif etype in {"process", "processwithreferenceproduct"}:
53
53
  path = os.path.join(os.path.dirname(__file__), "icons", "process.png")
54
54
  elif etype == "natural resource":
55
55
  path = os.path.join(os.path.dirname(__file__), "icons", "natural_resource.png")
@@ -140,7 +140,7 @@ class ActivityWindow(QtGui.QMainWindow):
140
140
  self.tree_view.setExpandsOnDoubleClick(False)
141
141
  self.tree_view.setSelectionBehavior(QtGui.QAbstractItemView.SelectionBehavior.SelectItems)
142
142
  #self.tree_view.rightClick.connect(self.rightClick)
143
- self.tree_view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
143
+ self.tree_view.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
144
144
  self.tree_view.customContextMenuRequested.connect(self.context_menu)
145
145
 
146
146
  def context_menu(self, point):
@@ -179,11 +179,29 @@ class ActivityWindow(QtGui.QMainWindow):
179
179
  super().show(*args, **kwargs)
180
180
  self.tree_view.setColumnWidth(0, 400)
181
181
 
182
+ # Replace IPython version to one compatible with Qt6
183
+ def start_event_loop_qt4(app=None):
184
+ """Start the qt event loop in a consistent manner."""
185
+ if app is None:
186
+ app = get_app_qt4([""])
187
+ if not is_event_loop_running_qt4(app):
188
+ app._in_event_loop = True
189
+ if hasattr(app, "exec_"):
190
+ app.exec_()
191
+ else:
192
+ app.exec()
193
+ app._in_event_loop = False
194
+ else:
195
+ app._in_event_loop = True
196
+
182
197
  def show_activity(act):
183
- if 'module://matplotlib_inline.backend_inline' == matplotlib.backends.backend:
184
- print("WARNING: ActivityGUI will block, use `%matplotlib qt` to avoid blocking")
185
- if matplotlib.backends.backend != "qtagg":
186
- print(f"unexpected backend {matplotlib.backends.backend}")
198
+
199
+ if 'matplotlib' in sys.modules:
200
+ import matplotlib
201
+ if hasattr(matplotlib.backends, "backend"):
202
+ if 'qt' not in matplotlib.backends.backend:
203
+ print("WARNING: ActivityGUI will block, use `%matplotlib qt` to avoid blocking")
204
+
187
205
  app = get_app_qt4()
188
206
 
189
207
  if (window := ActivityWindow.keep.get(act.key, None)) is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brightway-basic-explorer
3
- Version: 0.9.dev1
3
+ Version: 0.9.dev2
4
4
  Summary: Implement basic GUI to explorer brightway ativities
5
5
  Author-email: Benoît GSCHWIND <benoit.gschwind@minesparis.psl.eu>, OIE - Mines Paris PSL <benoit.gschwind@minesparis.psl.eu>
6
6
  Maintainer-email: Benoît GSCHWIND <benoit.gschwind@minesparis.psl.eu>
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: COPYING
19
+ Requires-Dist: ipython
19
20
  Dynamic: license-file
20
21
 
21
22
  # Brightway Basic Explorer
@@ -5,6 +5,7 @@ brightway_basic_explorer/__init__.py
5
5
  brightway_basic_explorer.egg-info/PKG-INFO
6
6
  brightway_basic_explorer.egg-info/SOURCES.txt
7
7
  brightway_basic_explorer.egg-info/dependency_links.txt
8
+ brightway_basic_explorer.egg-info/requires.txt
8
9
  brightway_basic_explorer.egg-info/top_level.txt
9
10
  brightway_basic_explorer/icons/emission.png
10
11
  brightway_basic_explorer/icons/natural_resource.png
@@ -12,8 +12,8 @@ name = "brightway-basic-explorer"
12
12
  description = "Implement basic GUI to explorer brightway ativities"
13
13
  readme = "README.md"
14
14
  license-files = ["COPYING"]
15
- version = "0.9.dev1"
16
- dependencies = [ ]
15
+ version = "0.9.dev2"
16
+ dependencies = [ "ipython" ]
17
17
  requires-python = ">= 3.10"
18
18
  keywords = ["lca", "ecoinvent", "brightway"]
19
19
  classifiers = [