cdasws 1.7.47__py3-none-any.whl → 1.8.2__py3-none-any.whl
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.
- cdasws/__init__.py +33 -23
- cdasws/timeinterval.py +21 -6
- {cdasws-1.7.47.dist-info → cdasws-1.8.2.dist-info}/METADATA +1 -1
- cdasws-1.8.2.dist-info/RECORD +13 -0
- cdasws-1.7.47.dist-info/RECORD +0 -13
- {cdasws-1.7.47.dist-info → cdasws-1.8.2.dist-info}/LICENSE +0 -0
- {cdasws-1.7.47.dist-info → cdasws-1.8.2.dist-info}/WHEEL +0 -0
- {cdasws-1.7.47.dist-info → cdasws-1.8.2.dist-info}/top_level.txt +0 -0
cdasws/__init__.py
CHANGED
|
@@ -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
|
-
|
|
45
|
-
to
|
|
46
|
-
|
|
47
|
-
|
|
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.
|
|
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.
|
|
614
|
-
will begin infinitely
|
|
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.
|
|
617
|
-
will end infinitely
|
|
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
|
cdasws/timeinterval.py
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
#
|
|
25
25
|
# NOSA HEADER END
|
|
26
26
|
#
|
|
27
|
-
# Copyright (c) 2018-
|
|
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 © 2018-
|
|
38
|
+
Copyright © 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.
|
|
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
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
cdasws/__init__.py,sha256=6gE6ZtcYu2YatV6N2Vnph7GkuGcmLnz88O4KW2IayCg,75472
|
|
2
|
+
cdasws/__main__.py,sha256=sgIqwgEaTto8mJggMAq3UppD6vus5DNQ4fWS3mvxvtY,12411
|
|
3
|
+
cdasws/cdasws.py,sha256=755mLWlMFXknNP3f8g_W9An6niAmksqcb1NdgiAybj0,29552
|
|
4
|
+
cdasws/datarepresentation.py,sha256=kKgAKCA4uzGoBQ8r8jbXstBg8SCg_EQtsoGhO8kIpco,2164
|
|
5
|
+
cdasws/datarequest.py,sha256=DutrESTuL9BVoMRymtVuxN4koXeaRxe9cT-jEoDVK8I,21632
|
|
6
|
+
cdasws/timeinterval.py,sha256=677SULpzclE4XqFuU4_SjZLVCZKlQKa2ekvswnmDVkU,6392
|
|
7
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
tests/test_cdasws.py,sha256=DsKesU19_9zUIO1a7oyWWtywBGN7gjdQHFLMGUZ4X8c,24395
|
|
9
|
+
cdasws-1.8.2.dist-info/LICENSE,sha256=og42scUY42lPLGBg0wHt6JtrbeInVEr5xojyrguPqrQ,12583
|
|
10
|
+
cdasws-1.8.2.dist-info/METADATA,sha256=jwm_durL4sr7uv27Cpd9Yr_bXdOVGD_iwPnWhEOIRJw,5744
|
|
11
|
+
cdasws-1.8.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
12
|
+
cdasws-1.8.2.dist-info/top_level.txt,sha256=GyIvHk5F6ysnTdDfnQsjZbTBt_EYrKyC0oeiIt9l-AE,7
|
|
13
|
+
cdasws-1.8.2.dist-info/RECORD,,
|
cdasws-1.7.47.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
cdasws/__init__.py,sha256=8UpPbGwbzIBxeAN7uWmwXbZMTiO1pJk565syQ7ZGtf0,74559
|
|
2
|
-
cdasws/__main__.py,sha256=sgIqwgEaTto8mJggMAq3UppD6vus5DNQ4fWS3mvxvtY,12411
|
|
3
|
-
cdasws/cdasws.py,sha256=755mLWlMFXknNP3f8g_W9An6niAmksqcb1NdgiAybj0,29552
|
|
4
|
-
cdasws/datarepresentation.py,sha256=kKgAKCA4uzGoBQ8r8jbXstBg8SCg_EQtsoGhO8kIpco,2164
|
|
5
|
-
cdasws/datarequest.py,sha256=DutrESTuL9BVoMRymtVuxN4koXeaRxe9cT-jEoDVK8I,21632
|
|
6
|
-
cdasws/timeinterval.py,sha256=d4i2Q8CtbAX0JdTLTCpyw40r16CycrUQACxhUVogu8E,5664
|
|
7
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
tests/test_cdasws.py,sha256=DsKesU19_9zUIO1a7oyWWtywBGN7gjdQHFLMGUZ4X8c,24395
|
|
9
|
-
cdasws-1.7.47.dist-info/LICENSE,sha256=og42scUY42lPLGBg0wHt6JtrbeInVEr5xojyrguPqrQ,12583
|
|
10
|
-
cdasws-1.7.47.dist-info/METADATA,sha256=f5qIZPV2tQArAIG4zPi62caRsfZ-967EP83IpVxQKLk,5745
|
|
11
|
-
cdasws-1.7.47.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
12
|
-
cdasws-1.7.47.dist-info/top_level.txt,sha256=GyIvHk5F6ysnTdDfnQsjZbTBt_EYrKyC0oeiIt9l-AE,7
|
|
13
|
-
cdasws-1.7.47.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|