hdpws 0.6.23__tar.gz → 0.6.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: hdpws
3
- Version: 0.6.23
3
+ Version: 0.6.24
4
4
  Summary: NASA's Heliophysics Data Portal Web Service Client Library
5
5
  Home-page: https://heliophysicsdata.gsfc.nasa.gov/WebServices
6
6
  Author: Bernie Harris
@@ -21,6 +21,19 @@ Classifier: Topic :: Scientific/Engineering :: Physics
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
+ Requires-Dist: python-dateutil>=2.8.0
25
+ Requires-Dist: requests>=2.20
26
+ Requires-Dist: urllib3>=1.26.14
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license
35
+ Dynamic: requires-dist
36
+ Dynamic: summary
24
37
 
25
38
 
26
39
  ## Synopsis
@@ -34,14 +34,14 @@
34
34
  Package for accessing the NASA's Heliophysics Data Portal (HDP) web
35
35
  services https://heliophysicsdata.gsfc.nasa.gov/WebServices/.
36
36
 
37
- Copyright © 2023-2024 United States Government as represented by the
37
+ Copyright © 2023-2025 United States Government as represented by the
38
38
  National Aeronautics and Space Administration. No copyright is claimed in
39
39
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
40
40
 
41
41
  """
42
42
 
43
43
 
44
- __version__ = "0.6.23"
44
+ __version__ = "0.6.24"
45
45
 
46
46
 
47
47
  #
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2023 United States Government as represented by
27
+ # Copyright (c) 2023-2025 United States Government as represented by
28
28
  # the National Aeronautics and Space Administration. No copyright is
29
29
  # claimed in the United States under Title 17, U.S.Code. All Other
30
30
  # Rights Reserved.
@@ -34,7 +34,7 @@
34
34
  Example Heliophysics Data Portal (HDP) web services client.
35
35
  https://heliophysicsdata.gsfc.nasa.gov/WebServices/.
36
36
 
37
- Copyright © 2023 United States Government as represented by the
37
+ Copyright © 2023-2025 United States Government as represented by the
38
38
  National Aeronautics and Space Administration. No copyright is claimed in
39
39
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
40
40
  """
@@ -410,6 +410,7 @@ def example(
410
410
  }
411
411
 
412
412
 
413
+ result = hdp.get_spase_software(query)
413
414
  if result['HttpStatus'] == 200:
414
415
  #print('HDP Spase:')
415
416
  #print(ET.tostring(result['Result']))
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: hdpws
3
- Version: 0.6.23
3
+ Version: 0.6.24
4
4
  Summary: NASA's Heliophysics Data Portal Web Service Client Library
5
5
  Home-page: https://heliophysicsdata.gsfc.nasa.gov/WebServices
6
6
  Author: Bernie Harris
@@ -21,6 +21,19 @@ Classifier: Topic :: Scientific/Engineering :: Physics
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
+ Requires-Dist: python-dateutil>=2.8.0
25
+ Requires-Dist: requests>=2.20
26
+ Requires-Dist: urllib3>=1.26.14
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license
35
+ Dynamic: requires-dist
36
+ Dynamic: summary
24
37
 
25
38
 
26
39
  ## Synopsis
@@ -10,7 +10,7 @@ README = (HERE / "README.md").read_text()
10
10
  # This call to setup() does all the work
11
11
  setup(
12
12
  name="hdpws",
13
- version="0.6.23",
13
+ version="0.6.24",
14
14
  description="NASA's Heliophysics Data Portal Web Service Client Library",
15
15
  long_description=README,
16
16
  long_description_content_type="text/markdown",
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2023-2024 United States Government as represented by
27
+ # Copyright (c) 2023-2025 United States Government as represented by
28
28
  # the National Aeronautics and Space Administration. No copyright is
29
29
  # claimed in the United States under Title 17, U.S.Code. All Other
30
30
  # Rights Reserved.
@@ -33,7 +33,7 @@
33
33
  """
34
34
  Module for unittest of the HdpWs class.<br>
35
35
 
36
- Copyright &copy; 2023 United States Government as represented by the
36
+ Copyright &copy; 2023-2025 United States Government as represented by the
37
37
  National Aeronautics and Space Administration. No copyright is claimed in
38
38
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
39
39
  """
@@ -74,7 +74,8 @@ class TestHdpWs(unittest.TestCase):
74
74
  self.assertEqual(result['HttpStatus'], 200)
75
75
  application_interfaces = result['ApplicationInterface']
76
76
  self.assertTrue(len(application_interfaces) > 0)
77
- self.assertTrue(application_interfaces[0] == 'CLI')
77
+ #print(f'ai = {application_interfaces}')
78
+ self.assertTrue(application_interfaces[0] == 'API')
78
79
 
79
80
 
80
81
  def test_get_keywords(self):
@@ -195,8 +196,10 @@ class TestHdpWs(unittest.TestCase):
195
196
  """
196
197
 
197
198
  resource_ids = [
198
- 'spase://NASA/Collection/IRIS_AIA',
199
- 'spase://SMWG/Service/CCMC/Models'
199
+ #'spase://NASA/Collection/IRIS_AIA',
200
+ 'spase://NASA/Collection/IRIS/IRIS_Hinode',
201
+ 'spase://SMWG/Service/CCMC/Models',
202
+ 'spase://NASA/NumericalData/LANL/1991/SOPA+ESP/PT10M'
200
203
  ]
201
204
  result = self._hdp.get_spase(resource_ids)
202
205
 
@@ -204,6 +207,38 @@ class TestHdpWs(unittest.TestCase):
204
207
  result = result['Result']
205
208
  result_id_elements = result.findall('.//ResourceID', namespaces=NS)
206
209
  result_ids = list(map(lambda e: e.text, result_id_elements))
210
+ #print(f'resources = {resource_ids}')
211
+ #print(f'result_ids = {result_ids}')
212
+ # self.assertTrue(len(result_ids) == 3)
213
+ # above should be == 2 when duplicate is removed from hdp and
214
+ # then the following will work
215
+ self.assertTrue(sorted(result_ids) == sorted(resource_ids))
216
+
217
+
218
+ def test_get_spase_w_prior_ids(self):
219
+ """
220
+ Test for get_spase function using PriorID values.
221
+ """
222
+
223
+ resource_ids = [
224
+ 'spase://NASA/Collection/IRIS/IRIS_Hinode',
225
+ 'spase://NASA/Catalog/CarringtonEvent/AuroralSightings',
226
+ 'spase://NASA/NumericalData/LANL/1991/SOPA+ESP/PT10M'
227
+ ]
228
+ prior_ids = [
229
+ 'spase://NASA/Collection/IRIS_HINODE',
230
+ 'spase://NASA/Catalog/Carrington_Event/Great_Magnetic_Storm_of_1859_List_of_Auroral_Sightings',
231
+ 'spase://VSPO/NumericalData/LANL/1991/SOPA+ESP/PT10M'
232
+ ]
233
+ result = self._hdp.get_spase(prior_ids)
234
+
235
+ self.assertEqual(result['HttpStatus'], 200)
236
+ result = result['Result']
237
+ result_id_elements = result.findall('.//ResourceID', namespaces=NS)
238
+ result_ids = list(map(lambda e: e.text, result_id_elements))
239
+ #print(f'resources = {resource_ids}')
240
+ #print(f'prior_ids = {prior_ids}')
241
+ #print(f'result_ids = {result_ids}')
207
242
  # self.assertTrue(len(result_ids) == 3)
208
243
  # above should be == 2 when duplicate is removed from hdp and
209
244
  # then the following will work
@@ -351,22 +386,53 @@ class TestHdpWs(unittest.TestCase):
351
386
  Test for get_spase_catalog function.
352
387
  """
353
388
 
389
+ #query = {
390
+ # 'InstrumentID': 'spase://SMWG/Instrument/ACE/MAG',
391
+ # 'PhenomenonType': 'MagneticCloud',
392
+ # 'Description': 'ICME'
393
+ #}
394
+ #time_range = ['1999-01-01', '1999-01-02']
395
+ query = {
396
+ 'InstrumentID': 'spase://SMWG/Instrument/Wind/MFI',
397
+ 'PhenomenonType': 'SolarWindExtreme'
398
+ }
399
+ time_range = ['1999-01-01', '1999-01-02']
400
+
401
+ result = self._hdp.get_spase_catalog(query, time_range)
402
+
403
+ #print(f'get_spase_catalog HttpStatus = {result["HttpStatus"]}')
404
+ self.assertEqual(result['HttpStatus'], 200)
405
+ result = result['Result']
406
+ result_id_elements = result.findall('.//ResourceID',
407
+ namespaces=NS)
408
+ result_ids = list(map(lambda e: e.text, result_id_elements))
409
+ self.assertTrue(len(result_ids) == 1)
410
+ #self.assertTrue(result_ids[0] == 'spase://NASA/Catalog/CME-ICME_Cho2003')
411
+ self.assertTrue(result_ids[0] == 'spase://NASA/Catalog/ISTP/SWCAT')
412
+
413
+
414
+ def test_get_spase_catalog_prior_id(self):
415
+ """
416
+ Test for get_spase_catalog function with a PriorID value for
417
+ ResourceID query.
418
+ """
419
+
420
+ #time_range = ['1999-01-01', '1999-01-02']
354
421
  query = {
355
- 'InstrumentID': 'spase://SMWG/Instrument/ACE/MAG',
356
- 'PhenomenonType': 'MagneticCloud',
357
- 'Description': 'ICME'
422
+ 'ResourceID': 'spase://VSPO/Catalog/ISTP/SWCAT'
358
423
  }
359
424
  time_range = ['1999-01-01', '1999-01-02']
360
425
 
361
426
  result = self._hdp.get_spase_catalog(query, time_range)
362
427
 
428
+ #print(f'get_spase_catalog HttpStatus = {result["HttpStatus"]}')
363
429
  self.assertEqual(result['HttpStatus'], 200)
364
430
  result = result['Result']
365
431
  result_id_elements = result.findall('.//ResourceID',
366
432
  namespaces=NS)
367
433
  result_ids = list(map(lambda e: e.text, result_id_elements))
368
434
  self.assertTrue(len(result_ids) == 1)
369
- self.assertTrue(result_ids[0] == 'spase://NASA/Catalog/CME-ICME_Cho2003')
435
+ self.assertTrue(result_ids[0] == 'spase://NASA/Catalog/ISTP/SWCAT')
370
436
 
371
437
 
372
438
  def test_get_spase_collection(self):
@@ -374,21 +440,51 @@ class TestHdpWs(unittest.TestCase):
374
440
  Test for get_spase_collection function.
375
441
  """
376
442
 
443
+ #query = {
444
+ # 'ResourceID': 'spase://NASA/Collection/IRIS_AIA',
445
+ # 'MemberID': 'spase://NASA/NumericalData/SDO/AIA/PT10S',
446
+ # 'Description': 'IRIS AND SDO and AIA'
447
+ #}
448
+ query = {
449
+ 'ResourceID': 'spase://NASA/Collection/IRIS/IRIS_Hinode',
450
+ 'MemberID': 'spase://NASA/NumericalData/IRIS/IRIS/PT1S',
451
+ 'Description': 'IRIS AND EIS and Hinode'
452
+ }
453
+
454
+ result = self._hdp.get_spase_collection(query)
455
+
456
+ #print(f'get_spase_collection HttpStatus = {result["HttpStatus"]}')
457
+ self.assertEqual(result['HttpStatus'], 200)
458
+ result = result['Result']
459
+ result_id_elements = result.findall('.//ResourceID',
460
+ namespaces=NS)
461
+ result_ids = list(map(lambda e: e.text, result_id_elements))
462
+ self.assertTrue(len(result_ids) == 1)
463
+ #self.assertTrue(result_ids[0] == 'spase://NASA/Collection/IRIS_AIA')
464
+ self.assertTrue(result_ids[0] == 'spase://NASA/Collection/IRIS/IRIS_Hinode')
465
+
466
+
467
+ def test_get_spase_collection_prior_id(self):
468
+ """
469
+ Test for get_spase_collection function with a prior_id.
470
+ """
471
+
377
472
  query = {
378
- 'ResourceID': 'spase://NASA/Collection/IRIS_AIA',
379
- 'MemberID': 'spase://NASA/NumericalData/SDO/AIA/PT10S',
380
- 'Description': 'IRIS AND SDO and AIA'
473
+ # PriorID
474
+ 'ResourceID': 'spase://NASA/Collection/IRIS_HINODE',
381
475
  }
382
476
 
383
477
  result = self._hdp.get_spase_collection(query)
384
478
 
479
+ #print(f'get_spase_collection HttpStatus = {result["HttpStatus"]}')
385
480
  self.assertEqual(result['HttpStatus'], 200)
386
481
  result = result['Result']
387
482
  result_id_elements = result.findall('.//ResourceID',
388
483
  namespaces=NS)
389
484
  result_ids = list(map(lambda e: e.text, result_id_elements))
485
+ #print(f'get_spase_collection: result_ids = {result_ids}')
390
486
  self.assertTrue(len(result_ids) == 1)
391
- self.assertTrue(result_ids[0] == 'spase://NASA/Collection/IRIS_AIA')
487
+ self.assertTrue(result_ids[0] == 'spase://NASA/Collection/IRIS/IRIS_Hinode')
392
488
 
393
489
 
394
490
  def test_get_spase_document(self):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes