Commit 228f512 1 parent a45fce4 commit 228f512 Copy full SHA for 228f512
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 11
11
from sdmx .model .common import Codelist
12
12
from sdmx .model .v21 import DataStructureDefinition
13
13
14
+ from message_ix_models .tools .exo_data import ExoDataSource
14
15
from message_ix_models .util import local_data_path
15
16
16
17
if TYPE_CHECKING :
@@ -159,6 +160,21 @@ def _transform(value: Any) -> str:
159
160
}
160
161
161
162
163
+ class PASTA (ExoDataSource ):
164
+ """Retrieve and process PASTA data for use in MESSAGEix-Transport."""
165
+
166
+ id = "PASTA"
167
+
168
+ def __init__ (self , source , source_kw ):
169
+ if not source == self .id :
170
+ raise ValueError (source )
171
+
172
+ self .raise_on_extra_kw (source_kw )
173
+
174
+ def __call__ (self ):
175
+ raise NotImplementedError
176
+
177
+
162
178
def gen_demand (context : "Context" ) -> dict [str , "AnyQuantity" ]:
163
179
"""Generate MESSAGEix-Transport demand data from PASTA.
164
180
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