Skip to content

Commit 768de5e

Browse files
committed
Initial changes to use providentia as a module
1 parent 42f64c1 commit 768de5e

File tree

184 files changed

+425
-3293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+425
-3293
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include providentia/settings *.yaml
2+
recursive-include providentia/assets *.png *.icns

configurations/module.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[DEBUG]
2+
network = EBAS
3+
species = sconco3
4+
resolution = hourly
5+
start_date = 20170101
6+
end_date = 20200101
7+
experiments = cams61_emep_ph2-eu-000, cams61_monarch_ph2-eu-000, cams61_silam_ph2-eu-000 (EMEP, MONARCH, SILAM)
8+
temporal_colocation = True
9+
spatial_colocation = False
10+
report_type = debug
11+
report_summary = True
12+
report_stations = False
13+
report_title = Providentia Report
14+
report_filename = /home/avilanov/data/providentia/reports/report.pdf
15+
statistic_mode = Temporal|Spatial
16+
statistic_aggregation = Median
17+
periodic_statistic_mode = Cycle
18+
periodic_statistic_aggregation = Median
19+
timeseries_statistic_aggregation = Median
20+
harmonise_summary = False
21+
harmonise_stations = False
22+
23+
[[Europe]]
24+
longitude = -28, 53
25+
latitude = 35, 72
26+
27+
[[Spain]]
28+
country = keep: Spain ||

providentia/actris.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import re
1212
import time
1313
from tqdm import tqdm
14+
import importlib.resources as pkg_resources
1415
import numpy as np
1516
import pandas as pd
1617
import pycountry
@@ -25,18 +26,18 @@
2526
PROVIDENTIA_ROOT = os.path.dirname(CURRENT_PATH)
2627

2728
# load ACTRIS mapping files
28-
ghost_actris_variables = yaml.safe_load(open(join(
29-
PROVIDENTIA_ROOT, 'settings', 'internal', 'actris', 'ghost_actris_variables.yaml')))
29+
ghost_actris_variables = yaml.safe_load(
30+
pkg_resources.open_text("providentia.settings.internal.actris", "ghost_actris_variables.yaml"))
3031
metadata_dict = yaml.safe_load(
31-
open(join(PROVIDENTIA_ROOT, 'settings', 'internal', 'actris', 'metadata.yaml')))
32+
pkg_resources.open_text("providentia.settings.internal.actris", "metadata.yaml"))
3233
coverages_dict = yaml.safe_load(
33-
open(join(PROVIDENTIA_ROOT, 'settings', 'internal', 'actris', 'coverages.yaml')))
34-
variable_mapping = yaml.safe_load(open(join(
35-
PROVIDENTIA_ROOT, 'settings', 'internal', 'actris', 'variable_mapping.yaml')))
34+
pkg_resources.open_text("providentia.settings.internal.actris", "coverages.yaml"))
35+
variable_mapping = yaml.safe_load(
36+
pkg_resources.open_text("providentia.settings.internal.actris", "variable_mapping.yaml"))
3637
variable_mapping = {k: v for k,
3738
v in variable_mapping.items() if k.strip() and v}
3839
flags_dict = yaml.safe_load(
39-
open(join(PROVIDENTIA_ROOT, 'settings', 'internal', 'actris', 'flags.yaml')))
40+
pkg_resources.open_text("providentia.settings.internal.actris", "flags.yaml"))
4041

4142
# initialise dictionary for storing pointers to shared memory variables in read step
4243
shared_memory_vars = {}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)