From 30f3c4da7120946bb449fc29a13ba31fffe6f532 Mon Sep 17 00:00:00 2001 From: bairdlangenbrunner Date: Thu, 12 Jul 2018 23:02:29 -0700 Subject: [PATCH] Merge branch 'master' of https://github.com/bairdlangenbrunner/python-for-climate-scientists --- _config.yml | 4 +- _site/404.html | 10 + _site/about/index.html | 10 + _site/coding/index.html | 20 +- .../_pages/setting-up-conda-environments.html | 216 ++++++++++++++++++ _site/feed.xml | 2 +- _site/index.html | 6 + .../setting-up-conda-environments.html | 24 +- .../setting-up-conda-environments.md | 0 9 files changed, 277 insertions(+), 15 deletions(-) create mode 100644 _site/collections/_pages/setting-up-conda-environments.html rename _site/{coding => pages}/setting-up-conda-environments.html (90%) rename collections/{_coding => _pages}/setting-up-conda-environments.md (100%) diff --git a/_config.yml b/_config.yml index 544c8fa..8f4191b 100644 --- a/_config.yml +++ b/_config.yml @@ -31,10 +31,12 @@ collections: collections: coding: output: true -# permalink: python-for-climate-scientists/:collection/:path +# permalink: python-for-climate-scientists/:collection/:path pages: output: true # permalink: /:name + pages: + output: true defaults: - scope: diff --git a/_site/404.html b/_site/404.html index d18a31d..586a101 100644 --- a/_site/404.html +++ b/_site/404.html @@ -37,6 +37,14 @@ +
  • + + conda environments for NCO, NCL, and CDO + +
  • + + +
  • about @@ -74,6 +82,8 @@ + +
  • diff --git a/_site/about/index.html b/_site/about/index.html index cb9579c..e1989fa 100644 --- a/_site/about/index.html +++ b/_site/about/index.html @@ -37,6 +37,14 @@ +
  • + + conda environments for NCO, NCL, and CDO + +
  • + + +
  • about @@ -74,6 +82,8 @@ + +
  • diff --git a/_site/coding/index.html b/_site/coding/index.html index c05f564..4556521 100644 --- a/_site/coding/index.html +++ b/_site/coding/index.html @@ -37,6 +37,14 @@ +
  • + + conda environments for NCO, NCL, and CDO + +
  • + + +
  • about @@ -74,6 +82,8 @@ + +
  • @@ -109,6 +119,10 @@

    coding tips

    diff --git a/_site/collections/_pages/setting-up-conda-environments.html b/_site/collections/_pages/setting-up-conda-environments.html new file mode 100644 index 0000000..7e292fb --- /dev/null +++ b/_site/collections/_pages/setting-up-conda-environments.html @@ -0,0 +1,216 @@ + + + + + + + + + conda environments for NCO, NCL, and CDO + + + + + + + + + + + + + + + + + + +
    + + + + +
    + +
    + +
    + + +
    +
    + +
    +

    conda environments for NCO, NCL, and CDO

    +
    + +
    +

    Environments in conda are incredibly useful: they allow you to install parallel versions of Python and its packages, or even other languages and software, that mind their own business and never affect one another.

    + +

    In my own research, I actively use several different conda environments to keep everything in its place. To see what environments you currently have, type conda list env. You’ll have at least one, called the base environment, and the asterisk means it’s the current/active environment:

    + +
    conda env list
    +
    +# conda environments:
    +#
    +base                  *  /Users/baird/miniconda3
    +
    +vcv076219:python-for-climate-scientists baird$
    +
    + +

    Installing an environment is also a great way to make the switch to a new Python library or package without breaking your installation for all your current scripts. For example, if you use basemap for plotting maps, you may have heard it’s being retired in the next couple years (see also this discussion). Its replacement is officially cartopy, but when you try to install them both, their packages conflict (or at least they did in the past). The solution: Install a separate cartopy environment to get used to it, and later switch your base environment over to cartopy.

    + +

    I typically keep at least four separate environments (in addition to the default), described below. You could get away with putting things like NCO and NCL into your base environment, but I’ve run into compatibility issues in the past, and I keep them separate to be safe.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    conda environmentuse forinstall commands
    basemost things
    nco_stableNCO (NetCDF Operators)conda install -c conda-forge nco
    ncl_stableNCL (NCAR Command Language)conda install -c conda-forge ncl
    cdo_stableCDO (Climate Data Operators)conda install -c conda-forge cdo
    basemap_stablebasmap (assuming you have cartopy in your base environment)conda install basemap
    + +

    To create these environments yourself (base is the default), type the following (choose y after each). I like to use the _stable suffix because it helps me mentally separate an environment related to NCO from the language itself. You can name them anything you like, though.

    +
    conda create --name nco_stable
    +conda create --name ncl_stable
    +conda create --name cdo_stable
    +
    + +
      +
    • To activate an environment: source activate env_name
    • +
    • To get back to your default conda: source deactivate
    • +
    • The active environment will have an asterisk next to it in conda env list
    • +
    + +
    +

    More to come…

    +
    + + +
    +
    + +
    + +
    +
    + +

    This website is a modification of Jekyll Swiss and is maintained by Baird. Contact me here.

    + + +
    +
    + + + + + diff --git a/_site/feed.xml b/_site/feed.xml index 60a0b50..825d85d 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -Jekyll2018-07-12T22:57:49-07:00http://localhost:4000/Python for climate scientistsMaterials for Earth science data wranglingBaird \ No newline at end of file +Jekyll2018-07-12T23:02:19-07:00http://localhost:4000/Python for climate scientistsMaterials for Earth science data wranglingBaird \ No newline at end of file diff --git a/_site/index.html b/_site/index.html index dff15b5..988a5a4 100644 --- a/_site/index.html +++ b/_site/index.html @@ -33,6 +33,12 @@ +
  • + conda environments for NCO, NCL, and CDO +
  • + + +
  • about
  • diff --git a/_site/coding/setting-up-conda-environments.html b/_site/pages/setting-up-conda-environments.html similarity index 90% rename from _site/coding/setting-up-conda-environments.html rename to _site/pages/setting-up-conda-environments.html index 10bb833..4dbde8d 100644 --- a/_site/coding/setting-up-conda-environments.html +++ b/_site/pages/setting-up-conda-environments.html @@ -13,7 +13,7 @@ - + @@ -37,6 +37,14 @@ +
  • + + conda environments for NCO, NCL, and CDO + +
  • + + +
  • about @@ -74,6 +82,8 @@ + +
  • @@ -100,13 +110,14 @@
    -
    +
    -

    conda environments for NCO, NCL, and CDO

    -
    +
    +

    conda environments for NCO, NCL, and CDO

    +
    -
    -

    Environments in conda are incredibly useful: they allow you to install parallel versions of Python and its packages, or even other languages and software, that mind their own business and never affect one another.

    +
    +

    Environments in conda are incredibly useful: they allow you to install parallel versions of Python and its packages, or even other languages and software, that mind their own business and never affect one another.

    In my own research, I actively use several different conda environments to keep everything in its place. To see what environments you currently have, type conda list env. You’ll have at least one, called the base environment, and the asterisk means it’s the current/active environment:

    @@ -178,7 +189,6 @@

    conda e

    -
    diff --git a/collections/_coding/setting-up-conda-environments.md b/collections/_pages/setting-up-conda-environments.md similarity index 100% rename from collections/_coding/setting-up-conda-environments.md rename to collections/_pages/setting-up-conda-environments.md