Skip to content

Commit

Permalink
Fix configuration exercise
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
  • Loading branch information
astrojuanlu committed Mar 10, 2023
1 parent f7dfdfc commit 37e00ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions swe4ds/configuration/README.md
Expand Up @@ -4,6 +4,12 @@ You were given some code that reads a set of files and applies some basic prepro

**Move hardcoded paths and magic numbers to a configuration file.**

## Setup

1. Create a new conda/mamba environment called `configuration310` with Python 3.10.
2. Activate the environment and install `pytest` on it.
3. Execute `pytest` to verify that none of the tests pass.

## Steps

1. Observe that some absolute paths have been included in the script. Probably they worked on the author's computer, but not anymore. Move the data files to a `data/` directory, and make the paths relative.
Expand Down
File renamed without changes.
@@ -1,6 +1,12 @@
import pytest

from main import load_yaml
from yaml import load, SafeLoader


def load_yaml(path):
with open(path) as fh:
contents = load(fh, Loader=SafeLoader)
return contents


def test_shuttles_includes_adjust_factor():
Expand Down

0 comments on commit 37e00ca

Please sign in to comment.