Skip to content

Commit

Permalink
Merge pull request #374 from RocketPy-Team/maint/upgrade-netcdf4-requ…
Browse files Browse the repository at this point in the history
…irement

MAINT: upgrade netcdf4 requirement
  • Loading branch information
Gui-FernandesBR authored Jun 14, 2023
2 parents 394877a + 339b615 commit 1b2c014
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
8 changes: 3 additions & 5 deletions docs/user/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following packages are needed in order to run RocketPy:
- Numpy >= 1.0
- Scipy >= 1.0
- Matplotlib >= 3.0
- netCDF4 >= 1.6.2 for Windows, MacOS or Python < '3.11'; netCDF4 >=1.4,<1.6 for Python 3.11+ in Linux
- netCDF4 >= 1.6.4
- windrose >= 1.6.8
- requests
- pytz
Expand All @@ -31,8 +31,6 @@ The following packages are needed in order to run RocketPy:
All of these packages, are automatically installed when RocketPy is installed using either ``pip`` or ``conda``.
However, in case the user wants to install these packages manually, they can do so by following the instructions bellow.

Note: Google Colab and netCDF4 don't play well together for netCDF4 >= 1.6 (see `this issue <https://github.com/Unidata/netcdf4-python/issues/1179>`_). If you are using Google Colab, you should install netCDF4 < 1.6 or use `condacolab <https://github.com/conda-incubator/condacolab>`_) to install netCDF4 >= 1.6.

Installing Required Packages Using ``pip``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -43,7 +41,7 @@ The packages needed can be installed via ``pip`` by running the following lines
pip install "numpy>=1.0"
pip install "scipy>=1.0"
pip install "matplotlib>=3.0"
pip install "netCDF4>=1.6.2"
pip install "netCDF4>=1.6.4"
pip install "windrose >= 1.6.8"
pip install "ipywidgets>=7.6.3"
pip install requests
Expand All @@ -61,7 +59,7 @@ To update Scipy and install netCDF4 using Conda, the following code is used:
.. code-block:: shell
conda install "scipy>=1.0"
conda install -c anaconda "netcdf4>=1.6.2"
conda install -c anaconda "netcdf4>=1.6.4"
Optional Packages
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
numpy>=1.0
scipy>=1.0
matplotlib>=3.0
netCDF4>=1.6.2; sys_platform != 'linux' or python_version < '3.11'
netCDF4>=1.4,<1.6; sys_platform == 'lixux' and python_version >= '3.11'
netCDF4>=1.6.4
windrose>=1.6.8
ipywidgets>=7.6.3
requests
Expand Down
14 changes: 1 addition & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
import os
import sys
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

# Manage different netCDF4 versions depending on system version and Google Colab
netCDF4_requirement = "netCDF4>=1.6.2"

# Check if running on a linux system
if sys.platform == "linux" and sys.version_info[1] < 11:
# Support for Linux with Python < 3.11
# Avoid problems due to netCDF4 issue linked below
# https://github.com/Unidata/netcdf4-python/issues/1179
netCDF4_requirement = "netCDF4>=1.4,<1.6"

setuptools.setup(
name="rocketpy",
version="0.13.1",
install_requires=[
"numpy>=1.0",
"scipy>=1.0",
"matplotlib>=3.0",
netCDF4_requirement,
"netCDF4>=1.6.4",
"windrose>=1.6.8",
"ipywidgets>=7.6.3",
"requests",
Expand Down

0 comments on commit 1b2c014

Please sign in to comment.