Skip to content

Commit 3b41189

Browse files
committed
style: fix style
1 parent bf11c6b commit 3b41189

File tree

19 files changed

+221
-91
lines changed

19 files changed

+221
-91
lines changed

.github/scripts/pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ tar -czvf everest-tutorials-drogon-well_order.tar.gz ./data/drogon/well_ord
88
tar -czvf everest-tutorials-drogon-well_rate.tar.gz ./data/drogon/well_rate
99
tar -czvf everest-tutorials-drogon-well_selection.tar.gz ./data/drogon/well_selection
1010
tar -czvf everest-tutorials-drogon-well_swap.tar.gz ./data/drogon/well_swap
11-
tar -czvf everest-tutorials-drogon-well_trajectory.tar.gz ./data/drogon/well_trajectory
11+
tar -czvf everest-tutorials-drogon-well_trajectory.tar.gz ./data/drogon/well_trajectory

.github/workflows/commitlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: commit lint
22

3-
on:
3+
on:
44
workflow_dispatch:
55
workflow_call:
66
push:
@@ -25,4 +25,4 @@ jobs:
2525
run: npm install @commitlint/{cli,config-conventional}
2626

2727
- name: run commitlint
28-
run: npx commitlint --from=$(git merge-base origin/main HEAD) --to=HEAD
28+
run: npx commitlint --from=$(git merge-base origin/main HEAD) --to=HEAD

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
workflow_call:
66
push:
7-
branches:
7+
branches:
88
- main
99

1010
permissions:
@@ -19,16 +19,16 @@ concurrency:
1919
jobs:
2020
publish:
2121
runs-on: ubuntu-latest
22-
22+
2323
environment:
2424
name: github-pages
2525
url: ${{ steps.deployment.outputs.page_url }}
26-
26+
2727
steps:
2828
- name: checkout code
2929
uses: actions/checkout@v4
3030
with:
31-
fetch-depth: 0
31+
fetch-depth: 0
3232

3333
- name: install uv
3434
uses: astral-sh/setup-uv@v5
@@ -38,15 +38,15 @@ jobs:
3838

3939
- name: build docs
4040
run: uv run sphinx-build -M html ./docs/source ./docs/build/
41-
41+
4242
- name: setup pages
4343
uses: actions/configure-pages@v5
44-
44+
4545
- name: upload artifact
4646
uses: actions/upload-pages-artifact@v3
4747
with:
4848
path: './docs/build/html'
49-
49+
5050
- name: deploy to github pages
5151
id: deployment
52-
uses: actions/deploy-pages@v4
52+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
if: ${{ steps.release.outputs.release_created }}
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
run: .github/scripts/upload.sh ${{ steps.release.outputs.tag_name }}
40+
run: .github/scripts/upload.sh ${{ steps.release.outputs.tag_name }}

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: Run style check
4747
if: ${{ always() }}
4848
run: |
49-
pre-commit run --all-files --show-diff-on-failure
49+
pre-commit run --all-files --show-diff-on-failure

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ wish to place an anonymous, confidential report we encourage to use the [Equinor
5454
Ethics
5555
helpline](https://secure.ethicspoint.eu/domain/media/en/gui/102166/index.html).
5656

57-
This helpline is hosted by a third party helpline provider.
57+
This helpline is hosted by a third party helpline provider.

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Contributors Guide
22

3-
Welcome to the **EVEREST™ Tutorials** repository!
4-
We appreciate your interest in contributing to this project.
3+
Welcome to the **EVEREST™ Tutorials** repository!
4+
We appreciate your interest in contributing to this project.
55

6-
We expect all contributors to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
6+
We expect all contributors to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
77
Be respectful and inclusive in all interactions.
88

99
Below are the guidelines to help you contribute effectively.
@@ -21,8 +21,8 @@ Below are the guidelines to help you contribute effectively.
2121

2222
## Introduction
2323

24-
The EVEREST Tutorials repository is focused on providing reproducible tutorials for EVEREST.
25-
This is a documentation-based repository with examples and configuration files that focus on practical usage.
24+
The EVEREST Tutorials repository is focused on providing reproducible tutorials for EVEREST.
25+
This is a documentation-based repository with examples and configuration files that focus on practical usage.
2626
Contributors are welcome to improve the tutorials, fix bugs, and suggest enhancements to the documentation.
2727

2828

@@ -68,7 +68,7 @@ We enforce this linting all commit and pull request messages using the [commitli
6868

6969
#### Commit Message Format
7070

71-
Each commit message consists of a `header`, a `body` and a `footer`.
71+
Each commit message consists of a `header`, a `body` and a `footer`.
7272
The header has a special format that includes a `type`, a `scope` and a `subject`:
7373

7474
```
@@ -83,7 +83,7 @@ The `header` and the `subject` are mandatory and the rest are optional.
8383
If there is a `body` you need to add a blank line between the header and the body.
8484
If there is `footer` you need to add a blank line between the body and the footer.
8585

86-
The footer can contain a `close` or `fixes` keyword to link to the issue and close it when the pull request is merged.
86+
The footer can contain a `close` or `fixes` keyword to link to the issue and close it when the pull request is merged.
8787
This behavior is described in [Linking a pull request to an issue using a keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
8888

8989
The accepted types follow the [Angular convention](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional#type-enum) and can be:
@@ -119,7 +119,7 @@ chore(main): release 0.4.1
119119

120120
### Pull Request Guidelines
121121

122-
The format of the pull request message is the same as the commit message.
122+
The format of the pull request message is the same as the commit message.
123123
Ensure your pull request is based on the latest main branch.
124124
Follow the repository's commit message format.
125125
Provide a clear description of the changes in the pull request.

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
extends: ['@commitlint/config-conventional'],
3-
};
3+
};

data/scripts/plot_controls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99

1010
RESULTS_FILE = (
11-
"optimization_output/ensembles/batch_{batch}/"
12-
"optimizer/realization_controls.parquet"
11+
"optimization_output/ensembles/batch_{batch}/optimizer/realization_controls.parquet"
1312
)
1413
PATH_PLOTS = "docs/source/well_order/images/optimization"
1514
FONTSIZE = 15

data/scripts/plot_production.py

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def read_summaries(
5858
all_dates_sets = []
5959

6060
for batch_number in batch_numbers:
61-
6261
smspec_files = find_smspec_files(simulation_folder, batch_number)
6362

6463
filtered_files = [
@@ -68,7 +67,6 @@ def read_summaries(
6867
]
6968

7069
for file_path in filtered_files:
71-
7270
# Load data including production rates and dates
7371
values_npv = summary.df(
7472
ResdataFiles(file_path),
@@ -116,35 +114,25 @@ def plot_summaries(
116114
percentile = 0.1
117115

118116
color_start = 0.5 # Start from 30% into the colormap to avoid very light colors
119-
color_end = 1.0 # End at the darkest color
120117

121118
batch_colors = [plt.cm.Blues(color_start), "red"]
122119
batch_colors = ["#00B7EB", "#FFFF00"]
123120
batch_colors = ["#58508d", "#ffa600"]
124121

125122
for keyword in keywords_to_be_plotted:
126-
127123
print(f"Plotting: {keyword}")
128124

129-
fig, ax = plt.subplots(figsize=(16, 9))
125+
_, ax = plt.subplots(figsize=(16, 9))
130126
max_means = []
131127

132128
for batch_index, batch in enumerate(batch_numbers):
133-
134129
if data_accumulator[batch][keyword]:
135130
# Concatenate and filter the data
136131
combined_data = pd.concat(
137132
data_accumulator[batch][keyword], ignore_index=True
138133
)
139134
combined_data = combined_data[combined_data["DATE"].isin(common_dates)]
140135

141-
# Group and calculate min/max
142-
min_max_grouped = (
143-
combined_data.groupby("DATE")[keyword]
144-
.agg(["min", "max"])
145-
.reset_index()
146-
)
147-
148136
if not combined_data.empty:
149137
combined_data.set_index("DATE", inplace=True)
150138
combined_data.sort_index(inplace=True)
@@ -156,8 +144,6 @@ def plot_summaries(
156144
mean_10_curve = combined_data.groupby(level=0)[keyword].quantile(
157145
percentile
158146
)
159-
max_mean_10_curve = max(mean_10_curve)
160-
max_mean_90_curve = max(mean_90_curve)
161147
max_mean_curve = max(mean_curve)
162148
max_means.append((batch_index, max_mean_curve))
163149
if keyword.startswith(("FWIT", "WWIR")):
@@ -215,30 +201,16 @@ def plot_summaries(
215201
label=label,
216202
)
217203

218-
if len(batch_numbers) == 1:
219-
220-
a = 1
221-
else:
204+
if len(batch_numbers) != 1:
222205
## if error, most prob. eclipse keyword or date not present in eclipse output
223206
try:
224207
if max_means[0][1] == 0:
225208
continue
226-
else:
227-
percentage_change = abs(max_means[1][1] - max_means[0][1])
228-
if max_means[1][1] < max_means[0][1]:
229-
pre_sign = "+"
230-
else:
231-
pre_sign = ""
232-
# print("percentage_change", percentage_change)
233209
except IndexError:
234210
print(
235211
"Plot will remain blank. Most probably, KEYWORD or DATE not present"
236212
)
237213

238-
max_means_str = ", ".join(
239-
f"Batch {idx}: {mean:,.1f}" for idx, mean in max_means
240-
)
241-
242214
ax.set_title(f"{keyword}", fontsize=24, fontweight="bold")
243215
ax.set_xlabel("Date", fontsize=26, fontweight="bold")
244216
ax.set_ylabel(
@@ -286,9 +258,7 @@ def plot_summaries(
286258

287259
casename = "wo"
288260
simulation_folder = (
289-
"../optimization/drogon/well_order/everest/output/"
290-
"WELLORDER_EXP"
291-
"/simulation_output/"
261+
"../optimization/drogon/well_order/everest/output/WELLORDER_EXP/simulation_output/"
292262
)
293263
plots_folder = "docs/source/well_order/images/production/"
294264

0 commit comments

Comments
 (0)