Skip to content
Merged

Dev #203

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ per-file-ignores =
logs*.py: F811
mathematical*.py: F401,F821,E402
n_reps*.py: E0602,F401,F821,W0611
outputs*.py: F811
outputs*.py: F811, F821, E0601
parallel*.py: F401,F821
parameters_file*.py: E402,F811,E0102
parameters_validation*.py: F821
Expand All @@ -16,4 +16,4 @@ per-file-ignores =
tests_resources/*.py: E0401
*/outputs_resources/*.py: E261,E262,F821
*/parallel_resources/*.py: E261,E262,F821
*/replications_resources/*.py: E261,E262,F821
*/replications_resources/*.py: E261,E262,F821
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ disable =
too-many-arguments,
too-many-instance-attributes,
too-many-lines,
too-many-positional-arguments
too-many-positional-arguments,
wrong-import-order
2 changes: 1 addition & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ dependencies:
- distfit==1.8.8
- jupytext==1.17.2
- kaleido==1.1.0
- lintquarto==0.5.0
- lintquarto==0.13.0
- sim-tools==1.0.0
2 changes: 1 addition & 1 deletion pages/guide/inputs/input_modelling.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ daily_arrivals_outliers = daily_arrivals.copy()

# One very high day and one very low day
high_day = pd.to_datetime("2025-02-15")
low_day = pd.to_datetime("2025-03-10")
low_day = pd.to_datetime("2025-03-10")

if high_day in daily_arrivals_outliers.index:
daily_arrivals_outliers.loc[high_day] *= 3
Expand Down
22 changes: 11 additions & 11 deletions pages/guide/inputs/parameters_file.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ There are several file types you can use to store parameters, with **CSV** and *
We will make a folder called `inputs` to store our parameter files within.

```{python}
data_path = "inputs"
DATA_PATH = "inputs"
```

:::
Expand All @@ -99,7 +99,7 @@ data_path <- file.path("inst", "extdata")

```{python}
#| echo: false
data_path = "parameters_file_resources"
DATA_PATH = "parameters_file_resources"
```

```{r}
Expand All @@ -117,7 +117,7 @@ For CSV files, use a simple tabular structure and follow tidy data principles -

```{python}
# Import and preview parameter file
csv_content = pd.read_csv(os.path.join(data_path, "example_parameters.csv"))
csv_content = pd.read_csv(os.path.join(DATA_PATH, "example_parameters.csv"))
HTML(to_html_datatable(csv_content))
```

Expand Down Expand Up @@ -163,7 +163,7 @@ For JSON files, data are stored in hierachical / nested structures. Keep the str
```{python}
# Import parameters
# pylint:disable=invalid-name
json_file = os.path.join(data_path, "example_parameters.json")
json_file = os.path.join(DATA_PATH, "example_parameters.json")
with open(json_file, "r", encoding="utf-8") as f:
json_content = json.load(f)

Expand Down Expand Up @@ -414,7 +414,7 @@ def create_parameters(json_file, number_of_runs=10):
return param_dict


param = create_parameters(os.path.join(data_path, "example_parameters.json"))
param = create_parameters(os.path.join(DATA_PATH, "example_parameters.json"))
print(json.dumps(param, indent=3))
```

Expand Down Expand Up @@ -447,7 +447,7 @@ def create_parameters(csv_file, number_of_runs=10):
return param_dict


param = create_parameters(os.path.join(data_path, "example_parameters.csv"))
param = create_parameters(os.path.join(DATA_PATH, "example_parameters.csv"))
print(json.dumps(param, indent=3))
```

Expand Down Expand Up @@ -479,7 +479,7 @@ def create_parameters(csv_file, number_of_runs=10):
return dict(param_dict)


param = create_parameters(os.path.join(data_path, "example_parameters.csv"))
param = create_parameters(os.path.join(DATA_PATH, "example_parameters.csv"))
print(json.dumps(param, indent=3))
```

Expand Down Expand Up @@ -609,7 +609,7 @@ class CreateParameters:
self.number_of_runs = number_of_runs


param = CreateParameters(os.path.join(data_path, "example_parameters.json"))
param = CreateParameters(os.path.join(DATA_PATH, "example_parameters.json"))
print(json.dumps(param.__dict__, indent=3))
```

Expand Down Expand Up @@ -642,7 +642,7 @@ class CreateParameters:
self.number_of_runs = number_of_runs


param = CreateParameters(os.path.join(data_path, "example_parameters.csv"))
param = CreateParameters(os.path.join(DATA_PATH, "example_parameters.csv"))
print(json.dumps(param.__dict__, indent=3))
```

Expand Down Expand Up @@ -678,7 +678,7 @@ class CreateParameters:
self.number_of_runs = number_of_runs


param = CreateParameters(os.path.join(data_path, "example_parameters.csv"))
param = CreateParameters(os.path.join(DATA_PATH, "example_parameters.csv"))
print(json.dumps(param.__dict__, indent=3))
```

Expand Down Expand Up @@ -771,7 +771,7 @@ def setup_param_from_csv(csv_path):

# Import parameters
params = setup_param_from_csv(
os.path.join(data_path, "example_parameters.csv")
os.path.join(DATA_PATH, "example_parameters.csv")
)

# View object
Expand Down
1 change: 0 additions & 1 deletion pages/guide/setup/code_structure.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ date: "2025-09-30T14:35:31+01:00"
The following imports are required. These should be available from environment setup on the [Structuring as a package](/pages/guide/setup/package.qmd) page.

```{python}
import numpy as np
import pandas as pd
```

Expand Down
Loading