Skip to content

Commit

Permalink
Remove references to "reader_dir" which is not longer required
Browse files Browse the repository at this point in the history
  • Loading branch information
tbody-cfs committed Aug 8, 2024
1 parent ad00fd0 commit 0da2efa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion radas/adas_interface/read_adf11_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def load_library(library_name: str, filepath: Path):


def read_adf11_file(
reader_dir, data_file_dir, species_name, dataset_type, dataset_config
data_file_dir, species_name, dataset_type
) -> dict:
"""Open and read an ADF11 OpenADAS file.
Expand Down
5 changes: 2 additions & 3 deletions radas/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ def run_radas(
if verbose:
print(f"Running radas in {radas_dir.absolute()}")
data_file_dir = radas_dir / "data_files"
reader_dir = radas_dir / "readers"
output_dir = radas_dir / "output"

for path in [radas_dir, data_file_dir, reader_dir, output_dir]:
for path in [radas_dir, data_file_dir, output_dir]:
path.mkdir(exist_ok=True)

if species == ("none",):
Expand Down Expand Up @@ -126,7 +125,7 @@ def run_radas(
(species_name in species) or (species == ("all",))
):
datasets[species_name] = read_rate_coeff(
reader_dir, data_file_dir, species_name, configuration
data_file_dir, species_name, configuration
)

output_dir.mkdir(exist_ok=True, parents=True)
Expand Down
9 changes: 3 additions & 6 deletions radas/read_rate_coeffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np


def read_rate_coeff(reader_dir, data_file_dir, species_name, config):
def read_rate_coeff(data_file_dir, species_name, config):
"""Builds a rate_dataset combining all of the raw data available for a given species."""
config_for_species = config["species"][species_name]

Expand All @@ -26,7 +26,6 @@ def read_rate_coeff(reader_dir, data_file_dir, species_name, config):

if reader_key == "adf11":
rate_dataset = build_adf11_rate_dataset(
reader_dir,
data_file_dir,
species_name,
dataset_type,
Expand Down Expand Up @@ -82,13 +81,11 @@ def determine_coordinates(dataset: xr.Dataset, rate_dataset: xr.Dataset):


def build_adf11_rate_dataset(
reader_dir, data_file_dir, species_name, dataset_type, dataset_config
data_file_dir, species_name, dataset_type, dataset_config
):
from .adas_interface.read_adf11_file import read_adf11_file

data = read_adf11_file(
reader_dir, data_file_dir, species_name, dataset_type, dataset_config
)
data = read_adf11_file(data_file_dir, species_name, dataset_type)

ds = xr.Dataset()

Expand Down
6 changes: 0 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ def data_file_dir(radas_dir):
return radas_dir / "data_files"


@pytest.fixture(scope="session")
def reader_dir(radas_dir):
(radas_dir / "readers").mkdir(exist_ok=False)
return radas_dir / "readers"


@pytest.fixture(scope="session")
def output_dir(radas_dir):
(radas_dir / "output").mkdir(exist_ok=False)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def test_download_species_data(data_file_dir, selected_species, configuration, v


@pytest.fixture()
def datasets(reader_dir, data_file_dir, selected_species, configuration, verbose):
def datasets(data_file_dir, selected_species, configuration, verbose):
from radas import read_rate_coeff

datasets = dict()

datasets[selected_species] = read_rate_coeff(
reader_dir, data_file_dir, selected_species, configuration
data_file_dir, selected_species, configuration
)

return datasets
Expand Down

0 comments on commit 0da2efa

Please sign in to comment.