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

Creation of multifunctional processes and databases #47

Open
17 tasks done
cmutel opened this issue Oct 3, 2024 · 2 comments
Open
17 tasks done

Creation of multifunctional processes and databases #47

cmutel opened this issue Oct 3, 2024 · 2 comments
Assignees

Comments

@cmutel
Copy link

cmutel commented Oct 3, 2024

Feature request

The current way we create processes in the GUI needs to be tweaked. Instead of this:

Screenshot 2024-10-07 at 06 15 32

We need to make the following changes:

  • Change the label of New activity -> New process.
  • Change the label of Duplicate activity to Duplicate node
  • Change the label of Delete activity to Delete node
Screenshot 2024-10-07 at 06 28 59
  • The GUI panel for New process should be changed
    • The layout should be changed to a grid of labels / text input boxes
    • The title of this panel should be changed to New process
    • The fields should be "Process name", "Reference product name", "Unit" (default="kilogram", node data attribute "unit"), "Location" (default="GLO", node data attribute "location"), and these should be applied to the newly created "process" node.
  • Creating a new process should also create a separate node of type product with the name of the "reference product" from the creation panel
    • The new product Node should take the "Reference product name" as "name", as well as "unit" and "location" attributes.
  • Creating a new process should create a new exchange on the new process:
new_process_node.new_edge(
    input=new_product_node,
    type=bw2data.labels.production_edge_default,
    amount=1,
)
  • A new action, New product, should be added to the contextual menu. This should pop up a menu

Users don't need to think about the Database type - this should be a reflection of the data in the database.

  • If we have the same product referenced as both an input and an output, it can only be functional in one place, not both places
  • The right inputs panel should have the column "functional"
  • If a process is edited so that it has two functional edges (looking across both the inputs and outputs), then its type needs to change to multifunctional, and the database backend needs to change to multifunctional.
  • If the database changes to "multifunctional", we need to pop up the default allocation box and make the user choose something (even if it has errors at first).
  • If the database backend changes to multifunctional, the left panel listing the nodes needs to be refreshed.
  • If a process is edited so that it has only one functional edge (looking across both the inputs and outputs), then its type needs to change to process.
@cmutel cmutel changed the title Automatic detection of multifunctional databases Creation of multifunctional processes and databases Oct 7, 2024
@cmutel
Copy link
Author

cmutel commented Oct 10, 2024

@zoltanszocs really great work so far, here are some refinements:

  • Instead of just disallowing making the same product functional in more than one place (this works), we need to give some feedback. Otherwise the user just feels like the software is broken. Can we have a modal popup with "Products can only be functional in one edge.\nThis product is already functional in:\n{edge}" or something similar?
  • Quick: When first creating a process, the creation of the product node and the edge from product node to process node works. However that edge should have "functional"=True.
  • Quick: The popup window when a database becomes multifunctional is great. Can we customize the language or add in an optional flag which is shown only when this change first happens which adds language like: "This database now has a multifunctional process. In order to do calculations correctly, we need to define a default allocation for this database. Please choose from the following possibilities:"
  • The popup window when a database becomes multifunctional is useless if we don't have any properties defined:
Screenshot 2024-10-10 at 09 31 41

In this case, if there is no possible allocation strategy, we should instead show a modal popup with the message: "This database now has a multifunctional process. In order to do calculations correctly, we need to define a default allocation; however, there are no properties available for all products. Defaulting to equal allocation, please add product properties and then select a different allocation method."

  • Quick: I can make the same product functional twice if both edges are in inputs. This should not be allowed. Sorry if this wasn't clear before.
Screenshot 2024-10-10 at 09 35 16

@cmutel
Copy link
Author

cmutel commented Oct 11, 2024

Some additional tasks taken from Slack:

  • Any time someone clicks on a checkbox in the functional column (either on or off) regardless of activity node type, do the following:
    • Save the exchange
    • Call exchange.output.allocate()
    • Call exchange.output.save()
    • Refresh the activity input/output tables and the lower left hand database table
  • Anytime a change is made to an exchange whose output type is multifunctional:
    • Save the exchange
    • Call exchange.output.allocate()
    • Call exchange.output.save() - This is needed to purge orphaned allocated processes who shouldn't exist anymore
    • Refresh the activity input/output tables and the lower left hand database table

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

No branches or pull requests

2 participants