Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: upgrade netcdf4 requirement #374

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/user/requirements.rst
Gui-FernandesBR marked this conversation as resolved.
Show resolved Hide resolved
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