Commit cda151d 1 parent 5270640 commit cda151d Copy full SHA for cda151d
File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 10
10
from sdmx .model .common import Codelist
11
11
from sdmx .model .v21 import DataStructureDefinition
12
12
13
+ from message_ix_models .tools .exo_data import ExoDataSource
13
14
from message_ix_models .util import local_data_path
14
15
15
16
if TYPE_CHECKING :
@@ -156,6 +157,21 @@ def _transform(value: Any) -> str:
156
157
}
157
158
158
159
160
+ class PASTA (ExoDataSource ):
161
+ """Retrieve and process PASTA data for use in MESSAGEix-Transport."""
162
+
163
+ id = "PASTA"
164
+
165
+ def __init__ (self , source , source_kw ):
166
+ if not source == self .id :
167
+ raise ValueError (source )
168
+
169
+ self .raise_on_extra_kw (source_kw )
170
+
171
+ def __call__ (self ):
172
+ raise NotImplementedError
173
+
174
+
159
175
def gen_demand (context : "Context" ) -> None :
160
176
"""Generate MESSAGEix-Transport demand data from PASTA.
161
177
Original file line number Diff line number Diff line change 2
2
3
3
import pytest
4
4
5
- from message_ix_models .project .edits import gen_demand , pasta_native_to_sdmx
5
+ from message_ix_models .project .edits import PASTA , gen_demand , pasta_native_to_sdmx
6
6
from message_ix_models .util import package_data_path
7
7
8
8
@@ -15,6 +15,11 @@ def test_pasta_data(test_context):
15
15
copyfile (package_data_path ("test" , * parts ), target )
16
16
17
17
18
+ class TestPASTA :
19
+ def test_init (self ) -> None :
20
+ PASTA ("PASTA" , {})
21
+
22
+
18
23
def test_pasta_native_to_sdmx (test_context , test_pasta_data ):
19
24
pasta_native_to_sdmx ()
20
25
You can’t perform that action at this time.
0 commit comments