mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
Updates to notebooks for python 3.12
- Fixed datetime deprecation issue with datetime.utcnow() to datetime.now(UTC) - Fixed deprecations related to numpy 2.0 - Fixed deprecations related to shapely 2.0 - Updated text products that had been consolidated/added Reference: https://github.com/Unidata/awips-unidata-builds/issues/167
This commit is contained in:
parent
46b347b5b7
commit
b90d7ed5e2
31 changed files with 11446 additions and 965 deletions
|
@ -1534,6 +1534,10 @@ vtec = {
|
|||
'sig': 'S',
|
||||
'color': 'olivedrab',
|
||||
'hdln': 'Coastal Flood Statement'},
|
||||
'CW.Y' : {'phen': 'CW',
|
||||
'sig': 'Y',
|
||||
'color': 'cadetblue',
|
||||
'hdln': 'Cold Weather Advisory'},
|
||||
'DS.W' : {'phen': 'DS',
|
||||
'sig': 'W',
|
||||
'color': 'bisque',
|
||||
|
@ -1674,14 +1678,6 @@ vtec = {
|
|||
'sig': 'W',
|
||||
'color': 'goldenrod',
|
||||
'hdln': 'High Wind Warning'},
|
||||
'HZ.A' : {'phen': 'HZ',
|
||||
'sig': 'A',
|
||||
'color': 'royalblue',
|
||||
'hdln': 'Hard Freeze Watch'},
|
||||
'HZ.W' : {'phen': 'HZ',
|
||||
'sig': 'W',
|
||||
'color': 'blue',
|
||||
'hdln': 'Hard Freeze Warning'},
|
||||
'IS.W' : {'phen': 'IS',
|
||||
'sig': 'W',
|
||||
'color': 'darkmagenta',
|
||||
|
@ -1870,18 +1866,6 @@ vtec = {
|
|||
'sig': 'Y',
|
||||
'color': '#00C0FF',
|
||||
'hdln': 'Freezing Spray Advisory'},
|
||||
'WC.A' : {'phen': 'WC',
|
||||
'sig': 'A',
|
||||
'color': 'cadetblue',
|
||||
'hdln': 'Wind Chill Watch'},
|
||||
'WC.W' : {'phen': 'WC',
|
||||
'sig': 'W',
|
||||
'color': 'lightsteelblue',
|
||||
'hdln': 'Wind Chill Warning'},
|
||||
'WC.Y' : {'phen': 'WC',
|
||||
'sig': 'Y',
|
||||
'color': 'paleturquoise',
|
||||
'hdln': 'Wind Chill Advisory'},
|
||||
'WI.Y' : {'phen': 'WI',
|
||||
'sig': 'Y',
|
||||
'color': 'tan',
|
||||
|
@ -1898,6 +1882,14 @@ vtec = {
|
|||
'sig': 'Y',
|
||||
'color': '#7b68ee',
|
||||
'hdln': 'Winter Weather Advisory'},
|
||||
'XH.A' : {'phen': 'XH',
|
||||
'sig': 'A',
|
||||
'color': 'maroon',
|
||||
'hdln': 'Extreme Heat Watch'},
|
||||
'XH.W' : {'phen': 'XH',
|
||||
'sig': 'W',
|
||||
'color': 'mediumvioletred',
|
||||
'hdln': 'Extreme Heat Warning'},
|
||||
'ZF.Y' : {'phen': 'ZF',
|
||||
'sig': 'Y',
|
||||
'color': 'teal',
|
||||
|
|
File diff suppressed because one or more lines are too long
405
docs/source/examples/notebooks/Colorized_Grid_Data.ipynb
Normal file
405
docs/source/examples/notebooks/Colorized_Grid_Data.ipynb
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
624
docs/source/examples/notebooks/GOES_CIRA_Product_Writer.ipynb
Normal file
624
docs/source/examples/notebooks/GOES_CIRA_Product_Writer.ipynb
Normal file
File diff suppressed because one or more lines are too long
1165
docs/source/examples/notebooks/Grid_Levels_and_Parameters.ipynb
Normal file
1165
docs/source/examples/notebooks/Grid_Levels_and_Parameters.ipynb
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1599
docs/source/examples/notebooks/Model_Sounding_Data.ipynb
Normal file
1599
docs/source/examples/notebooks/Model_Sounding_Data.ipynb
Normal file
File diff suppressed because one or more lines are too long
703
docs/source/examples/notebooks/NEXRAD_Level3_Radar.ipynb
Normal file
703
docs/source/examples/notebooks/NEXRAD_Level3_Radar.ipynb
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
929
docs/source/examples/notebooks/Regional_Surface_Obs_Plot.ipynb
Normal file
929
docs/source/examples/notebooks/Regional_Surface_Obs_Plot.ipynb
Normal file
File diff suppressed because one or more lines are too long
1168
docs/source/examples/notebooks/Satellite_Imagery.ipynb
Normal file
1168
docs/source/examples/notebooks/Satellite_Imagery.ipynb
Normal file
File diff suppressed because one or more lines are too long
524
docs/source/examples/notebooks/Upper_Air_BUFR_Soundings.ipynb
Normal file
524
docs/source/examples/notebooks/Upper_Air_BUFR_Soundings.ipynb
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -23,7 +23,7 @@ def setup(app):
|
|||
parallel_write_safe=True
|
||||
)
|
||||
|
||||
notebook_source_dir = '../../examples/notebooks'
|
||||
notebook_source_dir = 'examples/notebooks'
|
||||
generated_source_dir = 'examples/generated'
|
||||
|
||||
|
||||
|
|
|
@ -91,9 +91,9 @@ pythonToThriftMap = {
|
|||
numpy.int32: TType.I32,
|
||||
numpy.ndarray: TType.LIST,
|
||||
numpy.object_: TType.STRING, # making an assumption here
|
||||
numpy.string_: TType.STRING,
|
||||
numpy.bytes_: TType.STRING,
|
||||
# numpy.bytes_ is the same as numpy.string_
|
||||
numpy.unicode_: TType.STRING,
|
||||
numpy.str_: TType.STRING,
|
||||
# numpy.str_ is the same as numpy.unicode_
|
||||
numpy.float64: TType.DOUBLE,
|
||||
numpy.int16: TType.I16,
|
||||
|
@ -104,7 +104,7 @@ pythonToThriftMap = {
|
|||
primitiveSupport = (TType.BYTE, TType.I16, TType.I32, TType.I64,
|
||||
SelfDescribingBinaryProtocol.FLOAT, TType.DOUBLE)
|
||||
|
||||
BYTE_STRING_TYPES = {numpy.string_, numpy.bytes_, bytes}
|
||||
BYTE_STRING_TYPES = {numpy.bytes_, bytes}
|
||||
|
||||
|
||||
class ThriftSerializationContext(object):
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-beta.unidata.ucar.edu\")\n",
|
||||
"request = DataAccessLayer.newDataRequest()\n",
|
||||
"request.setDatatype(\"grid\")\n",
|
||||
"request.setLocationNames(\"RAP13\")\n",
|
||||
|
@ -367,7 +367,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.2"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"server = 'edex-cloud.unidata.ucar.edu'\n",
|
||||
"server = 'edex-beta.unidata.ucar.edu'\n",
|
||||
"DataAccessLayer.changeEDEXHost(server)"
|
||||
]
|
||||
},
|
||||
|
@ -582,7 +582,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.2"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Create an EDEX data request\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-beta.unidata.ucar.edu\")\n",
|
||||
"request = DataAccessLayer.newDataRequest()\n",
|
||||
"request.setDatatype(\"satellite\")"
|
||||
]
|
||||
|
@ -599,7 +599,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.5"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": "1",
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Unidata's cloud EDEX instance is used in this example\n",
|
||||
"edex_url = \"edex-cloud.unidata.ucar.edu\"\n",
|
||||
"edex_url = \"edex-beta.unidata.ucar.edu\"\n",
|
||||
"DataAccessLayer.changeEDEXHost(edex_url)"
|
||||
]
|
||||
},
|
||||
|
@ -1120,7 +1120,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.2"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
"source": [
|
||||
"from awips.dataaccess import DataAccessLayer\n",
|
||||
"from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange\n",
|
||||
"from datetime import datetime, timedelta\n",
|
||||
"from datetime import datetime, timedelta, UTC\n",
|
||||
"import numpy as np\n",
|
||||
"import cartopy.crs as ccrs\n",
|
||||
"import cartopy.feature as cfeature\n",
|
||||
|
@ -140,7 +140,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# EDEX Request\n",
|
||||
"edexServer = \"edex-cloud.unidata.ucar.edu\"\n",
|
||||
"edexServer = \"edex-beta.unidata.ucar.edu\"\n",
|
||||
"DataAccessLayer.changeEDEXHost(edexServer)\n",
|
||||
"request = DataAccessLayer.newDataRequest(\"obs\")\n",
|
||||
"\n",
|
||||
|
@ -211,7 +211,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Time range\n",
|
||||
"lastHourDateTime = datetime.utcnow() - timedelta(hours = 1)\n",
|
||||
"lastHourDateTime = datetime.now(UTC) - timedelta(hours = 1)\n",
|
||||
"start = lastHourDateTime.strftime('%Y-%m-%d %H')\n",
|
||||
"beginRange = datetime.strptime( start + \":00:00\", \"%Y-%m-%d %H:%M:%S\")\n",
|
||||
"endRange = datetime.strptime( start + \":59:59\", \"%Y-%m-%d %H:%M:%S\")\n",
|
||||
|
@ -266,9 +266,7 @@
|
|||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {
|
||||
"scrolled": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# define a dictionary and array that will be populated from our for loop below\n",
|
||||
|
@ -445,7 +443,7 @@
|
|||
"**datetime:**\n",
|
||||
"\n",
|
||||
"- [datetime.datetime](https://docs.python.org/3/library/datetime.html#datetime-objects)\n",
|
||||
"- [datetime.utcnow()](https://docs.python.org/3/library/datetime.html?#datetime.datetime.utcnow)\n",
|
||||
"- [datetime.now(UTC)](https://docs.python.org/3/library/datetime.html?#datetime.datetime.utcnow)\n",
|
||||
"- [datetime.timedelta](https://docs.python.org/3/library/datetime.html#timedelta-objects)\n",
|
||||
"- [datetime.strftime() and datetime.strptime()](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior)\n",
|
||||
"\n",
|
||||
|
@ -501,7 +499,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.5"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
@ -523,5 +521,5 @@
|
|||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 1
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Server, Data Request Type, and Database Table\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-beta.unidata.ucar.edu\")\n",
|
||||
"request = DataAccessLayer.newDataRequest('maps')"
|
||||
]
|
||||
},
|
||||
|
@ -660,7 +660,7 @@
|
|||
"\n",
|
||||
"* This notebook requires: **python-awips, numpy, matplotplib, cartopy, shapely**\n",
|
||||
"* Use datatype **maps** and **addIdentifier('table', <postgres maps schema>)** to define the map table:\n",
|
||||
" DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
|
||||
" DataAccessLayer.changeEDEXHost(\"edex-beta.unidata.ucar.edu\")\n",
|
||||
" request = DataAccessLayer.newDataRequest('maps')\n",
|
||||
" request.addIdentifier('table', 'mapdata.county')\n",
|
||||
"* Use **request.setLocationNames()** and **request.addIdentifier()** to spatially filter a map resource. In the example below, WFO ID **BOU** (Boulder, Colorado) is used to query counties within the BOU county watch area (CWA) \n",
|
||||
|
@ -700,7 +700,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.11"
|
||||
"version": "3.13.1"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
@ -717,5 +717,5 @@
|
|||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 1
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -95,7 +95,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Set the edex server\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-cloud.unidata.ucar.edu\")\n",
|
||||
"DataAccessLayer.changeEDEXHost(\"edex-beta.unidata.ucar.edu\")\n",
|
||||
"request = DataAccessLayer.newDataRequest()\n",
|
||||
"\n",
|
||||
"# Set data type\n",
|
||||
|
@ -496,7 +496,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.11"
|
||||
"version": "3.11.11"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
|
@ -513,5 +513,5 @@
|
|||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 1
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue