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

Prepare template documents for furo style docs #1131

Draft
wants to merge 103 commits into
base: dev
Choose a base branch
from

Conversation

fwitte
Copy link
Member

@fwitte fwitte commented Nov 8, 2024

Resolve #1074 (docs with appealing look)
Resolve #1132 (docs story line)
Resolve #1141 (beginner tutorials)

Note: #1142 (advanced tutorials) will be added later.

This PR prepares the change of the docs layout to the furo template. The following things have to considered before merging:

  • Check for compatibility of the old docs pages to the new template
  • Create darkmode replacements for every figure and logo
  • Insert darkmode/lightmode responsive figure inclusion code
  • Check if the docs actually build on readthedocs

On top of that, I updated the .readthedocs.yml configuration file to use the [dev] dependencies and a more up to date python version and delete the extra readthedocs specific requirements.txt file. It also introduces an announcement banner at the top of every page, where the content can be dynamically changed from the announcement.html file in the root of the announcements branch.

The plan is to crowdsource the necessary updates at the upcoming user-meeting.

Update:

  • Check installation instructions @srhbrnds
  • complete the tutorials @jfreissmann @maltefritz @p-snft @AntonellaGia
    • Finish the tutorial codes
    • Create icons for the grid view
    • Create plots and integrate them in the tutorial pages
  • Update the Support page @fwitte
  • Complete the figures for the grids in basic concepts and optimization sections @leroum

@pep8speaks
Copy link

pep8speaks commented Nov 8, 2024

Hello @fwitte! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 130:80: E501 line too long (122 > 79 characters)

Comment last updated at 2025-01-16 07:00:41 UTC

@fwitte
Copy link
Member Author

fwitte commented Nov 8, 2024

I added instructions to contribute to this change for the in person meeting in the respective issue #1074

fwitte and others added 24 commits November 21, 2024 15:31
Bachibouzouk and others added 22 commits February 27, 2025 10:28
…t entry (epsilon constraint) in this section
add the section best pratices to the docs and add the first entry (ep…
@p-snft
Copy link
Member

p-snft commented Apr 4, 2025

I feel like we should merge this rather soon so that it does not diverge from the other branches.

@fwitte
Copy link
Member Author

fwitte commented Apr 4, 2025

Good idea, should we make a mini sprint soon to collect, what to complete before merging, distributing tasks and implementing the changes?

@maltefritz
Copy link
Contributor

As you may have noticed, we have been busy with other things in the last time. But I agree with you that we need to hurry.

@fwitte: Feel free to suggest a date.

# %%[sec_11_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'fig' is unnecessary as it is
redefined
before this value is used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the first assignment to the variable fig on line 101, as it is immediately redefined on line 107 without being used in between. This will eliminate the redundancy and make the code cleaner.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -100,3 +100,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+# fig, ax = plt.subplot(figsize=[10, 6])
 # %%[sec_11_end]
EOF
@@ -100,3 +100,3 @@

fig, ax = plt.subplot(figsize=[10, 6])
# fig, ax = plt.subplot(figsize=[10, 6])
# %%[sec_11_end]
Copilot is powered by AI and may make mistakes. Always verify output.
# %%[sec_11_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'fig' is not used.

Copilot Autofix

AI 9 days ago

The best way to fix the problem is to remove the unused variable fig. This will clean up the code and eliminate any confusion about the purpose of the variable. Since the variable is not used anywhere in the code, removing it will not affect the existing functionality.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -100,3 +100,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+ax = plt.subplot(figsize=[10, 6])
 # %%[sec_11_end]
EOF
@@ -100,3 +100,3 @@

fig, ax = plt.subplot(figsize=[10, 6])
ax = plt.subplot(figsize=[10, 6])
# %%[sec_11_end]
Copilot is powered by AI and may make mistakes. Always verify output.
# %%[sec_11_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'ax' is unnecessary as it is
redefined
before this value is used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the first assignment to the variable ax on line 101, as it is immediately redefined on line 107 without being used in between. This will eliminate the redundancy and make the code cleaner and more efficient.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -100,3 +100,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+# fig, ax = plt.subplot(figsize=[10, 6])
 # %%[sec_11_end]
EOF
@@ -100,3 +100,3 @@

fig, ax = plt.subplot(figsize=[10, 6])
# fig, ax = plt.subplot(figsize=[10, 6])
# %%[sec_11_end]
Copilot is powered by AI and may make mistakes. Always verify output.
# %%[sec_11_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'ax' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we should remove the unused variable ax. This involves deleting the assignment of ax on line 101. Since ax is not used anywhere in the code, removing it will not affect the functionality of the code.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -100,3 +100,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+fig = plt.subplot(figsize=[10, 6])
 # %%[sec_11_end]
EOF
@@ -100,3 +100,3 @@

fig, ax = plt.subplot(figsize=[10, 6])
fig = plt.subplot(figsize=[10, 6])
# %%[sec_11_end]
Copilot is powered by AI and may make mistakes. Always verify output.
# %%[sec_12_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'fig' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the assignment of the unused variable fig on line 107. This will clean up the code and eliminate the unnecessary variable. Since the variable is not used anywhere in the code, we can safely delete the entire line without affecting the functionality of the code.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -106,3 +106,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+
 # %%[sec_12_end]
\ No newline at end of file
EOF
@@ -106,3 +106,3 @@

fig, ax = plt.subplot(figsize=[10, 6])

# %%[sec_12_end]
Copilot is powered by AI and may make mistakes. Always verify output.
# %%[sec_12_start]
import matplotlib.pyplot as plt

fig, ax = plt.subplot(figsize=[10, 6])

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'ax' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we should remove the unused variable ax. This will clean up the code and eliminate the warning. Since ax is not used anywhere in the code, we can safely remove its assignment without affecting the functionality of the code.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_1.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_1.py
@@ -106,3 +106,3 @@
 
-fig, ax = plt.subplot(figsize=[10, 6])
+fig = plt.subplot(figsize=[10, 6])
 # %%[sec_12_end]
\ No newline at end of file
EOF
@@ -106,3 +106,3 @@

fig, ax = plt.subplot(figsize=[10, 6])
fig = plt.subplot(figsize=[10, 6])
# %%[sec_12_end]
Copilot is powered by AI and may make mistakes. Always verify output.
@@ -0,0 +1,7 @@
# %%[sec_1]
import oemof.solph as solph

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'solph' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the unused import statement on line 2. This will eliminate the unnecessary dependency and make the code cleaner and easier to read. The import statement on line 5 should remain as it might be used in the subsequent code.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_2.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_2.py b/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
@@ -1,3 +1,3 @@
 # %%[sec_1]
-import oemof.solph as solph
+
 
EOF
@@ -1,3 +1,3 @@
# %%[sec_1]
import oemof.solph as solph


Copilot is powered by AI and may make mistakes. Always verify output.
import oemof.solph as solph

# %%[sec_2]
import oemof.solph as solph

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'solph' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the redundant import statement on line 5. This will eliminate the unnecessary dependency and make the code cleaner and more readable. No additional methods, imports, or definitions are needed to implement this change.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_2.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_2.py b/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_2.py
@@ -4,3 +4,3 @@
 # %%[sec_2]
-import oemof.solph as solph
+
 
EOF
@@ -4,3 +4,3 @@
# %%[sec_2]
import oemof.solph as solph


Copilot is powered by AI and may make mistakes. Always verify output.
@@ -0,0 +1,7 @@
# %%[sec_1]
import oemof.solph as solph

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'solph' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the unused import statement import oemof.solph as solph on line 2. This will eliminate the unnecessary dependency and make the code cleaner and easier to read.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_3.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_3.py b/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
@@ -1,3 +1,3 @@
 # %%[sec_1]
-import oemof.solph as solph
+
 
EOF
@@ -1,3 +1,3 @@
# %%[sec_1]
import oemof.solph as solph


Copilot is powered by AI and may make mistakes. Always verify output.
import oemof.solph as solph

# %%[sec_2]
import oemof.solph as solph

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'solph' is not used.

Copilot Autofix

AI 9 days ago

To fix the problem, we need to remove the redundant import statement on line 5. This will eliminate the unnecessary dependency and make the code cleaner. The best way to fix this issue is to delete the import statement on line 5 without affecting the existing functionality.

Suggested changeset 1
tutorial/introductory/district_heating_supply/district_heating_supply_3.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tutorial/introductory/district_heating_supply/district_heating_supply_3.py b/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
--- a/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
+++ b/tutorial/introductory/district_heating_supply/district_heating_supply_3.py
@@ -4,3 +4,3 @@
 # %%[sec_2]
-import oemof.solph as solph
+
 
EOF
@@ -4,3 +4,3 @@
# %%[sec_2]
import oemof.solph as solph


Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +9 to +12
The model time is defined by the number of intervals and the length of intervals. The length of each interval does not have to be the same. This can be defined in two ways:

1. Define the length of each interval in an array/Series where the number of the elements is the number of intervals.
2. Define a `pandas.DatetimeIndex` with all time steps that encloses an interval. Be aware that you have to define n+1 time points to get n intervals. For non-leap year with hourly values that means 8761 time points to get 8760 interval e.g. 2018-01-01 00:00 to 2019-01-01 00:00.
Copy link
Member

@p-snft p-snft Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giving intervals is no longer supported.

Suggested change
The model time is defined by the number of intervals and the length of intervals. The length of each interval does not have to be the same. This can be defined in two ways:
1. Define the length of each interval in an array/Series where the number of the elements is the number of intervals.
2. Define a `pandas.DatetimeIndex` with all time steps that encloses an interval. Be aware that you have to define n+1 time points to get n intervals. For non-leap year with hourly values that means 8761 time points to get 8760 interval e.g. 2018-01-01 00:00 to 2019-01-01 00:00.
The model time is defined by the number of intervals and the length of intervals. The length of each interval does not have to be the same. The intervals are defined by giving a `pandas.DatetimeIndex` with all time steps that define the intervals. Be aware that you have to define n+1 time points to get n intervals. For non-leap year with hourly values that means 8761 time points to get 8760 interval e.g. 2018-01-01 00:00 to 2019-01-01 00:00.


After defining an instance of the `EnergySystem` class, one need to add nodes and links between them to define the underlying network of the energy system.

There are two types of *nodes* : *components* and *buses*. Every Component has to be connected with one or more *buses*. The link between a *component* and a *bus* is called a *flow*.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make clear that bus -> bus is possible.

Suggested change
There are two types of *nodes* : *components* and *buses*. Every Component has to be connected with one or more *buses*. The link between a *component* and a *bus* is called a *flow*.
There are two types of *nodes* : *components* and *buses*. Every Component has to be connected with one or more *buses*. The link between a *component* and a *bus* (or between * two buses*) is called a *flow*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet