cdasws 1.7.46__tar.gz → 1.8.2__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
1
  Metadata-Version: 2.1
2
2
  Name: cdasws
3
- Version: 1.7.46
3
+ Version: 1.8.2
4
4
  Summary: NASA's Coordinated Data Analysis System Web Service Client Library
5
5
  Home-page: https://cdaweb.gsfc.nasa.gov/WebServices/REST
6
6
  Author: Bernie Harris
@@ -41,10 +41,17 @@ the United States under Title 17, U.S.Code. All Other Rights Reserved.
41
41
 
42
42
  Notes
43
43
  -----
44
- Due to rate limiting implemented by the CDAS web services, an attempt
45
- to make simultaneous requests from many threads is likely to actually
46
- reduce performance. At this time, it is best to make calls from
47
- five or fewer threads.
44
+ <ul>
45
+ <li>Due to rate limiting implemented by the CDAS web services, an
46
+ attempt to make simultaneous requests from many threads is likely
47
+ to actually reduce performance. At this time, it is best to make
48
+ calls from five or fewer threads.</li>
49
+ <li>Since CDAS data has datetime values with a UTC timezone, all
50
+ client provided datetime values should have a timezone of UTC.
51
+ If a given value's timezone is not UTC, the value is adjusted to
52
+ UTC. If a given value has no timezone (is naive), a UTC timezone
53
+ is set.</li>
54
+ </ul>
48
55
  """
49
56
 
50
57
 
@@ -120,7 +127,7 @@ except ImportError:
120
127
  CDF_XARRAY_AVAILABLE = False
121
128
 
122
129
 
123
- __version__ = "1.7.46"
130
+ __version__ = "1.8.2"
124
131
 
125
132
 
126
133
  #
@@ -610,11 +617,13 @@ class CdasWs:
610
617
  that no datasets are eliminated based upon their instrument
611
618
  value.<br>
612
619
  <b>startDate</b> - a datetime specifying the start of a time
613
- interval. If this parameter is ommited, the time interval
614
- will begin infinitely in the past.<br>
620
+ interval. See module note about timezone value. If this
621
+ parameter is ommited, the time interval will begin infinitely
622
+ in the past.<br>
615
623
  <b>stopDate</b> - a datetime specifying the end of a time
616
- interval. If this parameter is omitted, the time interval
617
- will end infinitely in the future.<br>
624
+ interval. See module note about timezone value. If this
625
+ parameter is omitted, the time interval will end infinitely
626
+ in the future.<br>
618
627
  <b>idPattern</b> - a java.util.regex compatible regular
619
628
  expression that must match the dataset's identifier value.
620
629
  Omitting this parameter is equivalent to `.*`.<br>
@@ -1025,9 +1034,9 @@ class CdasWs:
1025
1034
  variables
1026
1035
  array containing names of variables to get.
1027
1036
  start
1028
- start time of data to get.
1037
+ start time of data to get. See module note about timezone.
1029
1038
  end
1030
- end time of data to get.
1039
+ end time of data to get. See module note about timezone.
1031
1040
  keywords
1032
1041
  optional keyword parameters as follows:<br>
1033
1042
  <b>binData</b> - indicates that uniformly spaced values should
@@ -1263,10 +1272,11 @@ class CdasWs:
1263
1272
  ALL-VARIABLES may be used instead of specifying all the
1264
1273
  individual variable names.
1265
1274
  time0
1266
- TimeInterval(s) or start time of data to get.
1275
+ TimeInterval(s) or start time of data to get. See module
1276
+ note about timezone.
1267
1277
  time1
1268
1278
  when time0 is not one or more TimeInterval(s), the end time
1269
- of data to get.
1279
+ of data to get. See module note about timezone.
1270
1280
  keywords
1271
1281
  optional keyword parameters as follows:<br>
1272
1282
  <b>binData</b> - indicates that uniformly spaced values should
@@ -1449,9 +1459,9 @@ class CdasWs:
1449
1459
  variables
1450
1460
  array containing names of variables to get.
1451
1461
  start
1452
- start time of data to get.
1462
+ start time of data to get. See module note about timezone.
1453
1463
  end
1454
- end time of data to get.
1464
+ end time of data to get. See module note about timezone.
1455
1465
  options
1456
1466
  graph options.
1457
1467
  image_format
@@ -1552,9 +1562,9 @@ class CdasWs:
1552
1562
  variables
1553
1563
  array containing names of variables to get.
1554
1564
  start
1555
- start time of data to get.
1565
+ start time of data to get. See module note about timezone.
1556
1566
  end
1557
- end time of data to get.
1567
+ end time of data to get. See module note about timezone.
1558
1568
  identifier
1559
1569
  thumbnail identifier (returned in a previous get_graph
1560
1570
  result).
@@ -1651,9 +1661,9 @@ class CdasWs:
1651
1661
  variables
1652
1662
  array containing names of variables to get.
1653
1663
  start
1654
- start time of data to get.
1664
+ start time of data to get. See module note about timezone.
1655
1665
  end
1656
- end time of data to get.
1666
+ end time of data to get. See module note about timezone.
1657
1667
  compression
1658
1668
  file compression.
1659
1669
  text_format
@@ -1753,9 +1763,9 @@ class CdasWs:
1753
1763
  variables
1754
1764
  array containing names of variables to get.
1755
1765
  start
1756
- start time of data to get.
1766
+ start time of data to get. See module note about timezone.
1757
1767
  end
1758
- end time of data to get.
1768
+ end time of data to get. See module note about timezone.
1759
1769
  keywords
1760
1770
  optional keyword parameters as follows:<br>
1761
1771
  <b>binData</b> - indicates that uniformly spaced values should
@@ -1848,9 +1858,9 @@ class CdasWs:
1848
1858
  dataset
1849
1859
  dataset identifier of data to get.
1850
1860
  start
1851
- start time of data to get.
1861
+ start time of data to get. See module note about timezone.
1852
1862
  end
1853
- end time of data to get.
1863
+ end time of data to get. See module note about timezone.
1854
1864
  keywords
1855
1865
  optional keyword parameters as follows:<br>
1856
1866
  <b>progressCallback</b> - is a
@@ -24,7 +24,7 @@
24
24
  #
25
25
  # NOSA HEADER END
26
26
  #
27
- # Copyright (c) 2018-2021 United States Government as represented by
27
+ # Copyright (c) 2018-2024 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.
@@ -35,7 +35,7 @@
35
35
  Package defining a class to represent the TimeInterval class from
36
36
  <https://cdaweb.gsfc.nasa.gov/WebServices/REST/CDAS.xsd>.<br>
37
37
 
38
- Copyright &copy; 2018-2021 United States Government as represented by the
38
+ Copyright &copy; 2018-2024 United States Government as represented by the
39
39
  National Aeronautics and Space Administration. No copyright is claimed in
40
40
  the United States under Title 17, U.S.Code. All Other Rights Reserved.
41
41
  """
@@ -53,6 +53,14 @@ class TimeInterval:
53
53
  A class representing a TimeInterval class from
54
54
  <https://cdaweb.gsfc.nasa.gov/WebServices/REST/CDAS.xsd>.
55
55
 
56
+ Notes
57
+ -----
58
+ Since CDAS data uses datetime values with a UTC timezone,
59
+ the resulting start and end properties have a UTC timezone. If
60
+ the given values' timezone is not UTC, the start/end values are
61
+ adjusted to UTC. If the given value has no timezone (is naive) a
62
+ UTC value is set.
63
+
56
64
  Parameters
57
65
  ----------
58
66
  start
@@ -135,7 +143,11 @@ class TimeInterval:
135
143
  @staticmethod
136
144
  def get_datetime(value: Union[datetime, str]) -> datetime:
137
145
  """
138
- Produces a datetime representation of the given value.
146
+ Produces a datetime representation of the given value. The
147
+ returned datetime always has a timezone of timezone.utc. If
148
+ the given value's timezone is not utc, the return value is
149
+ adjusted to utc. If the given value has no timezone (is naive)
150
+ a utc value is set.
139
151
 
140
152
  Parameters
141
153
  ----------
@@ -144,7 +156,8 @@ class TimeInterval:
144
156
  Returns
145
157
  -------
146
158
  datetime
147
- datetime representation of the given value.
159
+ datetime representation of the given value in the UTC
160
+ timezone.
148
161
  Raises
149
162
  ------
150
163
  ValueError
@@ -157,9 +170,11 @@ class TimeInterval:
157
170
  else:
158
171
  raise ValueError('unrecognized datetime value')
159
172
 
160
- datetime_value.astimezone(timezone.utc)
173
+ if datetime_value.tzinfo is None or \
174
+ datetime_value.tzinfo.utcoffset(None) is None:
175
+ return datetime_value.replace(tzinfo=timezone.utc)
161
176
 
162
- return datetime_value
177
+ return datetime_value.astimezone(timezone.utc)
163
178
 
164
179
 
165
180
  @staticmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdasws
3
- Version: 1.7.46
3
+ Version: 1.8.2
4
4
  Summary: NASA's Coordinated Data Analysis System Web Service Client Library
5
5
  Home-page: https://cdaweb.gsfc.nasa.gov/WebServices/REST
6
6
  Author: Bernie Harris
@@ -1,8 +1,9 @@
1
1
  python-dateutil>=2.8.0
2
2
  requests>=2.20
3
+ urllib3>=1.24.1
3
4
 
4
5
  [spdm]
5
- spacepy>=0.1.6
6
+ spacepy>=0.5.0
6
7
 
7
8
  [xarray]
8
9
  cdflib>=0.4.4
@@ -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="cdasws",
13
- version="1.7.46",
13
+ version="1.8.2",
14
14
  description="NASA's Coordinated Data Analysis System Web Service Client Library",
15
15
  long_description=README,
16
16
  long_description_content_type="text/markdown",
@@ -22,10 +22,10 @@ setup(
22
22
  # packages=find_packages(exclude=["tests"]),
23
23
  # packages=find_packages(),
24
24
  include_package_data=True,
25
- # install_requires=["python-dateutil>=2.8.0", "requests>=2.20", "spacepy>=0.1.6"],
26
- install_requires=["python-dateutil>=2.8.0", "requests>=2.20"],
25
+ # install_requires=["python-dateutil>=2.8.0", "requests>=2.20", "urllib3>=1.24.1", "spacepy>=0.5.0"],
26
+ install_requires=["python-dateutil>=2.8.0", "requests>=2.20", "urllib3>=1.24.1"],
27
27
  extras_require={
28
- 'spdm': ["spacepy>=0.1.6"],
28
+ 'spdm': ["spacepy>=0.5.0"],
29
29
  'xarray': ["cdflib>=0.4.4"],
30
30
  },
31
31
  keywords=["heliophysics", "coordinated data analysis", "multi-mission", "multi-instrument", "space physics", "spdf", "cdaweb"],
File without changes
File without changes
File without changes
File without changes