Skip to content

Commit

Permalink
Wiki updates (#1371)
Browse files Browse the repository at this point in the history
* update tutorial

* Update Databases.md

* Update Projects.md
  • Loading branch information
marc-vdm authored Sep 24, 2024
1 parent a5b060a commit 01eac53
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 112 deletions.
76 changes: 52 additions & 24 deletions activity_browser/docs/wiki/Databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,68 @@
> Please help us improve the wiki by reading our
> [contributing guidelines](https://github.com/LCA-ActivityBrowser/activity-browser/blob/main/CONTRIBUTING.md#wiki).
Databases are the main way in which Brightway manages and stores [Activities](Activities). Use databases to organize
your data in a meaningful way, for example by separating foreground and background systems.
Databases are the main way in which Brightway manages and stores [Activities](Activities).
Use databases to organize your data in a meaningful way, for example by separating foreground and background systems.

[Read more about data organization in Brightway...](Getting-Started#organization-of-data-in-brightway-and-activity-browser)

Brightway databases consist of two parts:

1. **Backend:** this is where the actual activity data lives. Most users will be using the SQLite backend, which stores
data in the _databases.db_ found in the project folder.
1. **Backend:** this is where the actual activity data lives.
Most users will be using the SQLite backend, which stores data in the _databases.db_ found in the project folder.
2. **Metadata:** this is where database specific metadata is stored, such as dependent databases, number of activities,
and time of last edit.
and time of last edit.

Databases that are installed in a project may be found in the `Databases` section, part of the `Project` panel.
This section shows a table that displays a selection of the metadata for all the databases in the project.

> [!NOTE]
> This panel is not yet visible when no databases have been installed into the project yet.
> Instead, a button to set up your project will be shown.
>
> [Read more about setting up a project...](Getting-Started#setting-up-a-project)
## Basic functions

### Opening a database
You can open a database by double-clicking its entry within the `Databases` table.
This will open a tab at the bottom of the `Project` panel that contains a table showing all [activities](Activities)
that the database contains.

### Creating a new database
You can create a new database by clicking the `New database...` button in the `Databases` table.
This will prompt you to enter a unique name for the database, after which the newly created database will open and you
can start adding activities as desired.

### Deleting a database
You can delete a database by right-clicking on its entry withing the `Databases` table and selecting `Delete database`,
this will prompt you for a confirmation.

> [!WARNING]
> Deleting a database can not be undone and any exchanges between activities in the database and any other database will
> be deleted, all activities in the database that were used in a calculation setup will also be removed from the setup.
>
> Make sure you anticipate the consequences of deleting a database before doing so!
Databases that are installed in a project may be found in the `Databases` section, part of the `Project` panel. This
section shows a table that displays a selection of the metadata for all the databases in the project. **Note:** this
panel is not yet visible when no databases have been installed into the project yet. Instead, a button to set up your
project will be shown.
### Duplicating a database
You can duplicate a database by right-clicking on its entry withing the `Databases` table.
This will prompt to enter a unique name for the new database, after which the newly duplicated database will open.

# Basic functions
### Relinking a database
Databases are often connected to other databases by exchanges.
Sometimes, you may want to replace the connections from a database to another, as an example:

## Opening a database
You can open a database by double-clicking its entry within the `Databases` section. This will open a tab at the bottom
of the `Project` panel that contains a table showing all [activities](Activities) that the database contains.
You have 2 databases, database _A_ and _B_, _B_ uses activities that are in _A_.
You duplicated a database _A_ to make and test some changes to _A_copy_, and now want to change the links in _B_ to _A_copy_.

## Creating a new database
You can create a new database by clicking the `New database...` button in the `Databases` section. This will prompt you
to enter a unique name for the database, after which the newly created database will open and you can start adding
activities as desired.
To relink a database, you can right-click on its entry in the `Databases` table and choose `Relink the database`.
In the pop-up, you can choose a new link for every database your database depends on.

## Deleting a database
You can delete a database by right-clicking on its entry withing the `Databases` section and selecting `Delete database` This will prompt you for a
confirmation. Note that any exchanges that are dependent on activities within the database will be removed as well. Make
sure you anticipate this.
Relinking will only work if exact matches are found for the `name`, `reference product` adn `unit` for the activities.
Any activities not relinked will remain linked to the old database.

## Duplicating a database
You can duplicate a database by right-clicking on its entry withing the `Databases` section. This will prompt to enter a
unique name for the database, after which the newly duplicated database will open.
> [!NOTE]
> Relinking can be a slow process, as it needs to check every exchange in every activity in the database.
[//]: # (# Importing)

Expand Down
98 changes: 52 additions & 46 deletions activity_browser/docs/wiki/Projects.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,85 @@
Projects are one of the many ways in which [Brightway](https://docs.brightway.dev/en/latest/) helps you structure your data. A project is a standalone
environment in which you store your [LCI databases](Databases), [Impact Categories](Impact-Categories), [Calculation Setups](LCA-Calculation-Setups) and any other data. Data that
is stored in project **One** cannot be used in project **Two** and vice versa. Use this to your advantage in any way you like.
Projects are one of the many ways in which [Brightway](https://docs.brightway.dev/en/latest/) helps you structure your data.
A project is a standalone environment in which you store your
[LCI databases](Databases), [Impact Categories](Impact-Categories), [Calculation Setups](LCA-Calculation-Setups) and any other data.
Data that is stored in project _One_ cannot be used in project _Two_ and vice versa.
Use this to your advantage in any way you like.

[Read more about data organization in Brightway...](Getting-Started#organization-of-data-in-brightway-and-activity-browser)

Projects are stored separately from your Activity Browser installation in a folder dependent on your operating system
and user preferences. This means you can install multiple version of Activity Browser and access the same projects. It
also means that removing Activity Browser is not going to fix any issues related to your project.
and user preferences.
This means you can install multiple version of Activity Browser and access the same projects.
It also means that removing Activity Browser is not going to remove projects or fix any issues related to your project.

If you want to know where a particular project is stored, check the Activity Browser console window, which will display
the folder for the current project when you open it.

## Selecting a project

When you launch the Activity Browser you will be dropped into your startup project, Brightway's "default" project by
default. You can always see what project you are in by checking the window title bar, the toolbar at the bottom of the
screen, or see what project is selected in the drop-down menu at the top of the project tab.

You can switch between projects in one of two ways: you can either choose a project from project tab's drop-down menu,
or through the `Project` menu in the main menu bar.
default.
You can always see what project you are in by checking the window title bar, the toolbar at the bottom of the
screen, or see what project is selected in the drop-down menu at the top of the `Project` tab.

- `Project` > `Open project` > _Choose your desired project_
You can switch between projects in one of two ways: through the `Project` > `Open project` menu in the main menu bar
or you can either choose a project from `Project` tab's drop-down menu.

## Creating a new project

You can create a new project by either clicking the `New` button at the top of the Project tab, or through the
`Project` menu in the main menu bar.
You can create a new project by either `Project` > `New` menu in the main menu bar
or by clicking the `New` button at the top of the `Project` tab.

- `Project` > `New`
You'll be asked to provide a unique name for your new project, after which the Activity Browser will create and switch \
to your new project and allow you to set-up your project in any way you like.

You'll be asked to provide a unique name for your new project, after which the Activity Browser will switch to your new
project and allow you to setup your project in any way you like.
[Read more about setting up a project...](Getting-Started#setting-up-a-project)

## Deleting a project
You can delete your current project by either clicking the `Delete` button at the top of the Project tab, or through the
`Project` menu in the main menu bar.
You can delete your current project by either the
`Project` > `Delete` menu in the main menu bar or by clicking the `Delete` button at the top of the `Project` tab.

- `Project` > `Delete`
You will be asked for confirmation and whether you want to delete the project folder from the disk as well.
If you do not delete your project from disk, Brightway will just unregister the project, which will hide it from the project selection
menus, but the data is preserved in the project folder mentioned above.
If you choose to delete it from disk entirely, the project and its data are removed entirely.

You'll be asked for confirmation and whether you want to delete the project folder from the disk as well. If you do not
delete your project from disk, Brightway will just unregister the project, which will hide it from the project selection
menu's, but the data is preserved in the project folder mentioned above. If you choose to delete it from disk entirely,
the project and it's data are removed entirely.
> [!WARNING]
> Deleting a project from disk can not be undone.
>
> Make sure you anticipate the consequences of deleting a projecgt before doing so!
## Duplicating a project
You can duplicate your current project by either clicking the **Duplicate** button at the top of the Project tab, or through the
`Project` menu in the main menu bar.
You can duplicate your current project by either the `Project` > `Duplicate` menu in the main menu bar
or clicking the `Duplicate` button at the top of the Project tab.

- `Project` > `Duplicate`

You'll be asked to provide a unique name for your duplicate project, after which the Activity Browser will switch to this
project. This feature is handy if you want to test out anything that may break your data, by first duplicating your project
You will be asked to provide a unique name for your duplicate project, after which the Activity Browser will switch
to the duplicated project.
This feature is useful if you want to test out anything that may break your data, by first duplicating your project
you ensure that your data is preserved if you want to return to it.

## Exporting a project
You can export your entire project to a .7z archive. This archive will contain all data stored within the project like
LCI databases, Impact Categories and Calculation Setups. You can export your project through the `Project` menu in the
You can export your entire project to a .7z archive.
This archive will contain all data stored within the project like
[LCI databases](Databases), [Impact Categories](Impact-Categories), [Calculation Setups](LCA-Calculation-Setups) and any other data.
You can export your project through the `Project` > `Export this project` menu in the
main menu bar.

- `Project` > `Export this project`
You will be asked for a location the .7z archive with your project data should be saved to.

You will be asked for a location the .7z archive with your project data should be saved to. Exporting may take a while
to complete.
> [!NOTE]
> Exporting may take a while to complete, especially for large projects with many databases.
## Importing a project
Similarly, you can also import a project that has been exported to a .7z archive. You can import the project through the
`Project` menu in the main menu bar.

- `Project` > `Import a project`
Similarly, you can also import a project that has been exported to a .7z archive.
You can import the project through the `Project` > `Import a project` menu in the main menu bar.

You will be prompted for a unique project name, after which the project will be installed and the Activity Browser will
switch to your imported project.

## A note on Brightway25 projects
Brightway25 is not yet officially supported by the Activity Browser. Projects created using Brightway25 use a different
structure and managing them through the Activity Browser may cause breaking issues. Brightway25 projects are shown in
the project selection menus, but disabled for this reason.
## Brightway25 projects
> [!IMPORTANT]
> Brightway25 is not yet officially supported by the Activity Browser.
> Projects created using Brightway25 use a different structure
> and managing them through the Activity Browser may cause breaking issues.
> Brightway25 projects are shown in the project selection menus, but cannot yet be used in Activity Browser.
If you know what you're doing feel free to enable these projects by setting the `AB_BW25` environmental variable. Needless
to say this is at your own risk.
If you know what you're doing feel free to enable these projects by setting the `AB_BW25` environmental variable.
Needless to say this is at your own risk, we will not provide you with support for this yet.
Loading

0 comments on commit 01eac53

Please sign in to comment.