Skip to content

Commit

Permalink
pre-commits
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Aug 30, 2023
1 parent 1e9d45f commit 703c6c4
Show file tree
Hide file tree
Showing 24 changed files with 132 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['erddapy']\n",
"\n",
"deps = [\"erddapy\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['cf_xarray', 'palettable', 'seawater']\n",
"\n",
"deps = [\"cf_xarray\", \"palettable\", \"seawater\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['iris', 'seawater']\n",
"\n",
"deps = [\"iris\", \"seawater\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,15 @@
"catalog = TDSCatalog(\"https://thredds.cencoos.org/thredds/catalog.xml\")\n",
"\n",
"\n",
"info = \"\"\"\n",
"info = f\"\"\"\n",
"Catalog information\n",
"-------------------\n",
"\n",
"Base THREDDS URL: {}\n",
"Catalog name: {}\n",
"Catalog URL: {}\n",
"Metadata: {}\n",
"\"\"\".format(\n",
" catalog.base_tds_url, catalog.catalog_name, catalog.catalog_url, catalog.metadata\n",
")\n",
"Base THREDDS URL: {catalog.base_tds_url}\n",
"Catalog name: {catalog.catalog_name}\n",
"Catalog URL: {catalog.catalog_url}\n",
"Metadata: {catalog.metadata}\n",
"\"\"\"\n",
"\n",
"print(info)"
]
Expand Down Expand Up @@ -234,13 +232,11 @@
}
],
"source": [
"info = \"\"\"\n",
"Href: {}\n",
"Name: {}\n",
"Title: {}\n",
"\"\"\".format(\n",
" ref.href, ref.name, ref.title\n",
")\n",
"info = f\"\"\"\n",
"Href: {ref.href}\n",
"Name: {ref.name}\n",
"Title: {ref.title}\n",
"\"\"\"\n",
"\n",
"print(info)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['erddapy']\n",
"\n",
"deps = [\"erddapy\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['owslib']\n",
"\n",
"deps = [\"owslib\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down Expand Up @@ -139,10 +143,8 @@
" \"SCCOOS\": \"Southern California Coastal Ocean Observing System\",\n",
" \"SECOORA\": \"Southeast Coastal Ocean Observing Regional Association\",\n",
" }\n",
" reg_assoc = '(dataThemeinstitutions_s:\"{}\" dataThemeprojects_s:\"{} ({})\")'.format(\n",
" RAs[ra],\n",
" RAs[ra],\n",
" ra,\n",
" reg_assoc = (\n",
" f'(dataThemeinstitutions_s:\"{RAs[ra]}\" dataThemeprojects_s:\"{RAs[ra]} ({ra})\")'\n",
" )\n",
"\n",
"# Identify the project.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['cf-units', 'ioos-tools', 'pyoos', 'retrying']\n",
"\n",
"deps = [\"cf-units\", \"ioos-tools\", \"pyoos\", \"retrying\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down Expand Up @@ -72,7 +76,7 @@
},
"outputs": [],
"source": [
"import sys\n",
"import sys # noqa\n",
"from pathlib import Path\n",
"from urllib.request import urlopen, urlretrieve\n",
"\n",
Expand Down Expand Up @@ -6544,7 +6548,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['cartopy']\n",
"\n",
"deps = [\"cartopy\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['palettable']\n",
"\n",
"deps = [\"palettable\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['erddapy', 'palettable']\n",
"\n",
"deps = [\"erddapy\", \"palettable\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down Expand Up @@ -1216,9 +1220,7 @@
" )\n",
" if len(var) > 2:\n",
" raise Exception(\n",
" \"Found more than 1 variable with `standard_names` {}\\n{!r}\".format(\n",
" standard_names, var\n",
" )\n",
" f\"Found more than 1 variable with `standard_names` {standard_names}\\n{var!r}\"\n",
" )\n",
" variables.extend(var)\n",
" return variables"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['cartopy', 'gridgeo', 'netcdf4', 'palettable']\n",
"\n",
"deps = [\"cartopy\", \"gridgeo\", \"netcdf4\", \"palettable\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['cf-units', 'ioos-tools', 'pyoos', 'retrying']\n",
"\n",
"deps = [\"cf-units\", \"ioos-tools\", \"pyoos\", \"retrying\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['ipyleaflet']\n",
"\n",
"deps = [\"ipyleaflet\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['erddapy', 'ipyleaflet', 'seawater']\n",
"\n",
"deps = [\"erddapy\", \"ipyleaflet\", \"seawater\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"import subprocess\n",
"import sys\n",
"\n",
"\n",
"def _install(package):\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])\n",
"\n",
"\n",
"def _colab_install_missing_deps(deps):\n",
" import importlib\n",
"\n",
" for dep in deps:\n",
" if importlib.util.find_spec(dep) is None:\n",
" _install(dep)\n",
"\n",
"deps = ['geoplot', 'pyobis']\n",
"\n",
"deps = [\"geoplot\", \"pyobis\"]\n",
"_colab_install_missing_deps(deps)"
]
},
Expand Down
Loading

0 comments on commit 703c6c4

Please sign in to comment.