Skip to content

Commit

Permalink
Merge pull request #267 from RoseauTechnologies/update_doc_colab
Browse files Browse the repository at this point in the history
Activate License in Google Colab
  • Loading branch information
benoit9126 authored Sep 17, 2024
2 parents 382deaa + 5440cc4 commit f3baaae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ og:description: See what's new in the latest release of Roseau Load Flow !

# Changelog

## Unreleased

- {gh-pr}`267` Add a section in the documentation on Google Colab secrets.

## Version 0.10.0

- A wheel for Python 3.13 is also available.
- A wheel for Python 3.13 is available.
- The wheels for Windows are now available. The problem was the same as the one of the
[issue 28551](https://github.com/matplotlib/matplotlib/issues/28551) of the Matplotlib repository.
- {gh-pr}`237` Improvements of the Sphinx configuration.
Expand Down
18 changes: 17 additions & 1 deletion doc/License.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,26 @@ the license key from versioning by adding it to your `.gitignore` file.
## How to set an environment variable?

If you are not sure how to set an environment variable, [this article](https://www.bitecode.dev/p/environment-variables-for-beginners)
has instructions for Windows, MacOS and Linux. The section [Persisting an environment variable](https://www.bitecode.dev/i/121864947/persisting-an-environment-variable)
has instructions for Windows, macOS and Linux. The section [Persisting an environment variable](https://www.bitecode.dev/i/121864947/persisting-an-environment-variable)
explains how to make the environment variable persistent on your machine so that you don't have to
set it every time you open a new terminal.

### For Google Colab users

The "Secrets" feature in Google Colab is very useful for defining local variables. In the left panel, open the 'Secrets' section. Create a new variable called `ROSEAU_LOAD_FLOW_LICENSE_KEY`, with the value being your license key. This variable is personal to you, and the toggle will allow you to enable access to the license key for notebooks of your choice.

```{image} /_static/2024_09_16_Google_Colab_Environment_Variable.png
:alt: Google Colab environment variable
:align: center
```

To set the environment variable, add the following in a cell at the beginning of your notebook:

```
from google.colab import userdata
os.environ['ROSEAU_LOAD_FLOW_LICENSE_KEY'] = userdata.get('ROSEAU_LOAD_FLOW_LICENSE_KEY')
```

### For Jupyter Notebook users

If you are using a _Jupyter Notebook_, you can follow these instructions to set the environment
Expand Down
3 changes: 3 additions & 0 deletions doc/_static/2024_09_16_Google_Colab_Environment_Variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f3baaae

Please sign in to comment.