8000 Replace tables/pytables with h5py (#1299) · VeryBigCorp/pvlib-python@403f65e · GitHub
[go: up one dir, main page]

Skip to content

Commit 403f65e

Browse files
authored
Replace tables/pytables with h5py (pvlib#1299)
* Revert "Make tables a required dependency (pvlib#1287)" This reverts commit 65782fd. * replace tables with h5py * fix pr number * fiddle with 3.6-min yml * fix clearsky.rst * fiddle with whatsnew
1 parent c1bbf71 commit 403f65e

File tree

13 files changed

+18
-61
lines changed
  • pvlib
  • 13 files changed

    +18
    -61
    lines changed

    azure-pipelines.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -12,7 +12,7 @@ jobs:
    1212
    vmImage: ubuntu-16.04
    1313

    1414

    15-
    - template: ci/azure/posix_no_39.yml
    15+
    - template: ci/azure/posix.yml
    1616
    parameters:
    1717
    name: Test_bare_macOS
    1818
    vmImage: macOS-10.14

    benchmarks/asv.conf.json

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -119,7 +119,7 @@
    119119
    "pandas": "0.22.0",
    120120
    "scipy": "1.2.0",
    121121
    // Note: these don't have a minimum in setup.py
    122-
    "pytables": "3.6.1",
    122+
    "h5py": "2.10.0",
    123123
    "ephem": "3.7.6.0",
    124124
    "numba": "0.36.1",
    125125
    },
    @@ -129,7 +129,7 @@
    129129
    "numpy": "",
    130130
    "pandas": "",
    131131
    "scipy": "",
    132-
    "pytables": "",
    132+
    "h5py": "",
    133133
    "ephem": "",
    134134
    "numba": ""
    135135
    },

    ci/azure/posix_no_39.yml

    Lines changed: 0 additions & 39 deletions
    This file was deleted.

    ci/requirements-py36-min.yml

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -5,7 +5,6 @@ dependencies:
    55
    - coveralls
    66
    - nose
    77
    - pip
    8-
    - pytables # tables when using pip+PyPI
    98
    - pytest
    109
    - pytest-cov
    1110
    - pytest-mock
    @@ -15,10 +14,10 @@ dependencies:
    1514
    - requests
    1615
    - pip:
    1716
    - dataclasses
    17+
    - h5py==3.1.0
    1818
    - numpy==1.12.0
    1919
    - pandas==0.22.0
    2020
    - scipy==1.2.0
    2121
    - pytest-rerunfailures # conda version is >3.6
    2222
    - pytest-remotedata # conda package is 0.3.0, needs > 0.3.1
    2323
    - requests-mock
    24-
    - numexpr==2.6.2 # needed for tables, but newest version is not compatible with numpy 1.12

    ci/requirements-py36.yml

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -3,17 +3,16 @@ channels:
    33
    - defaults
    44
    - conda-forge
    55
    dependencies:
    6-
    - blosc=1.14.3 # newest version breaks tables (pytables) on windows
    76
    - coveralls
    87
    - cython
    98
    - ephem
    9+
    - h5py
    1010
    - netcdf4
    1111
    - nose
    1212
    - numba
    1313
    - numpy >= 1.12.0
    1414
    - pandas >= 0.22.0
    1515
    - pip
    16-
    - pytables # tables when using pip+PyPI
    1716
    - pytest
    1817
    - pytest-cov
    1918
    - pytest-mock

    ci/requirements-py37.yml

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -3,17 +3,16 @@ channels:
    33
    - defaults
    44
    - conda-forge
    55
    dependencies:
    6-
    - blosc=1.14.3 # newest version breaks tables (pytables) on windows
    76
    - coveralls
    87
    - cython
    98
    - ephem
    9+
    - h5py
    1010
    - netcdf4
    1111
    - nose
    1212
    - numba
    1313
    - numpy >= 1.12.0
    1414
    - pandas >= 0.22.0
    1515
    - pip
    16-
    - pytables # tables when using pip+PyPI
    1716
    - pytest
    1817
    - pytest-cov
    1918
    - pytest-mock

    ci/requirements-py38.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -6,13 +6,13 @@ dependencies:
    66
    - coveralls
    77
    - cython
    88
    - ephem
    9+
    - h5py
    910
    - netcdf4
    1011
    - nose
    1112
    - numba
    1213
    - numpy >= 1.12.0
    1314
    - pandas >= 0.22.0
    1415
    - pip
    15-
    - pytables # tables when using pip+PyPI
    1616
    - pytest
    1717
    - pytest-cov
    1818
    - pytest-mock

    ci/requirements-py39.yml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -6,13 +6,13 @@ dependencies:
    66
    - coveralls
    77
    - cython
    88
    - ephem
    9+
    - h5py
    910
    # - netcdf4 # pulls in a different version of numpy with ImportError
    1011
    - nose
    1112
    # - numba # python 3.9 compat in early 2021
    1213
    - numpy >= 1.12.0
    1314
    - pandas >= 0.22.0
    1415
    - pip
    15-
    - pytables # tables when using pip+PyPI
    1616
    - pytest
    1717
    - pytest-cov
    1818
    - pytest-mock

    docs/sphinx/source/clearsky.rst

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -132,16 +132,16 @@ the year. You could run it in a loop to create plots for all months.
    132132

    133133
    In [1]: import os
    134134

    135-
    In [1]: import tables
    135+
    In [1]: import h5py
    136136

    137137
    In [1]: pvlib_path = os.path.dirname(os.path.abspath(pvlib.clearsky.__file__))
    138138

    139139
    In [1]: filepath = os.path.join(pvlib_path, 'data', 'LinkeTurbidities.h5')
    140140

    141141
    In [1]: def plot_turbidity_map(month, vmin=1, vmax=100):
    142142
    ...: plt.figure();
    143-
    ...: with tables.open_file(filepath) as lt_h5_file:
    144-
    ...: ltdata = lt_h5_file.root.LinkeTurbidity[:, :, month-1]
    143+
    ...: with h5py.File(filepath, 'r') as lt_h5_file:
    144+
    ...: ltdata = lt_h5_file['LinkeTurbidity'][:, :, month-1]
    145145
    ...: plt.imshow(ltdata, vmin=vmin, vmax=vmax);
    146146
    ...: # data is in units of 20 x turbidity
    147147
    ...: plt.title('Linke turbidity x 20, ' + calendar.month_name[month]);

    docs/sphinx/source/installation.rst

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -235,7 +235,6 @@ A handful of pvlib-python features require additional packages that must
    235235
    be installed separately using pip or conda. These packages/features
    236236
    include:
    237237

    238-
    * pytables (tables on PyPI): Linke turbidity look up for clear sky models
    239238
    * statsmodels: parameter fitting
    240239
    * numba: fastest solar position calculations
    241240
    * pyephem: solar positions calculations using an astronomical library

    0 commit comments

    Comments
     (0)
    0