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]: Remove tests from wheel distro #2277

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ coverage.xml


# Datafiles
*.csv
# Ignore some csv
!pvlib/data/*.csv
# Do not exclude data directories
!pvlib/data/**
!pvlib/tests/data/**

# vi
*.swp
Expand Down
8 changes: 6 additions & 2 deletions docs/sphinx/source/whatsnew/v0.11.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Deprecations

Enhancements
~~~~~~~~~~~~

* Reduced space requirements by excluding tests and test files from wheel.
Zipped wheel is now 66% of the previous size, and installed size is 50% of
the previous size.
(:issue:`2271`, :pull:`2277`)

Documentation
~~~~~~~~~~~~~
Expand All @@ -21,7 +24,8 @@ Documentation

Testing
~~~~~~~

* Moved data exclusively used in tests to ``pvlib/tests/data``.
(:issue:`2271`, :pull:`2277`)

Requirements
~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion pvlib/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def assert_frame_equal(left, right, **kwargs):

# commonly used directories in the tests
TEST_DIR = Path(__file__).parent
DATA_DIR = TEST_DIR.parent / 'data'
PVLIB_DATA_DIR = TEST_DIR.parent / 'data'
TESTS_DATA_DIR = TEST_DIR / 'data'


# pytest-rerunfailures variables
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
Index,photocurrent,saturation_current,resistance_series,resistance_shunt,n,cells_in_series
1,1.0,5e-10,0.1,300,1.01,72
2,1.0,5e-10,0.1,300,1.3,72
3,1.0,5e-10,0.1,3000,1.01,72
4,1.0,5e-10,0.1,3000,1.3,72
5,1.0,5e-10,1.0,300,1.01,72
6,1.0,5e-10,1.0,300,1.3,72
7,1.0,5e-10,1.0,3000,1.01,72
8,1.0,5e-10,1.0,3000,1.3,72
9,1.0,3e-08,0.1,300,1.01,72
10,1.0,3e-08,0.1,300,1.3,72
11,1.0,3e-08,0.1,3000,1.01,72
12,1.0,3e-08,0.1,3000,1.3,72
13,1.0,3e-08,1.0,300,1.01,72
14,1.0,3e-08,1.0,300,1.3,72
15,1.0,3e-08,1.0,3000,1.01,72
16,1.0,3e-08,1.0,3000,1.3,72
17,8.0,5e-10,0.1,300,1.01,72
18,8.0,5e-10,0.1,300,1.3,72
19,8.0,5e-10,0.1,3000,1.01,72
20,8.0,5e-10,0.1,3000,1.3,72
21,8.0,5e-10,1.0,300,1.01,72
22,8.0,5e-10,1.0,300,1.3,72
23,8.0,5e-10,1.0,3000,1.01,72
24,8.0,5e-10,1.0,3000,1.3,72
25,8.0,3e-08,0.1,300,1.01,72
26,8.0,3e-08,0.1,300,1.3,72
27,8.0,3e-08,0.1,3000,1.01,72
28,8.0,3e-08,0.1,3000,1.3,72
29,8.0,3e-08,1.0,300,1.01,72
30,8.0,3e-08,1.0,300,1.3,72
31,8.0,3e-08,1.0,3000,1.01,72
32,8.0,3e-08,1.0,3000,1.3,72
Index,photocurrent,saturation_current,resistance_series,resistance_shunt,n,cells_in_series
1,1.0,5e-10,0.1,300,1.01,72
2,1.0,5e-10,0.1,300,1.3,72
3,1.0,5e-10,0.1,3000,1.01,72
4,1.0,5e-10,0.1,3000,1.3,72
5,1.0,5e-10,1.0,300,1.01,72
6,1.0,5e-10,1.0,300,1.3,72
7,1.0,5e-10,1.0,3000,1.01,72
8,1.0,5e-10,1.0,3000,1.3,72
9,1.0,3e-08,0.1,300,1.01,72
10,1.0,3e-08,0.1,300,1.3,72
11,1.0,3e-08,0.1,3000,1.01,72
12,1.0,3e-08,0.1,3000,1.3,72
13,1.0,3e-08,1.0,300,1.01,72
14,1.0,3e-08,1.0,300,1.3,72
15,1.0,3e-08,1.0,3000,1.01,72
16,1.0,3e-08,1.0,3000,1.3,72
17,8.0,5e-10,0.1,300,1.01,72
18,8.0,5e-10,0.1,300,1.3,72
19,8.0,5e-10,0.1,3000,1.01,72
20,8.0,5e-10,0.1,3000,1.3,72
21,8.0,5e-10,1.0,300,1.01,72
22,8.0,5e-10,1.0,300,1.3,72
23,8.0,5e-10,1.0,3000,1.01,72
24,8.0,5e-10,1.0,3000,1.3,72
25,8.0,3e-08,0.1,300,1.01,72
26,8.0,3e-08,0.1,300,1.3,72
27,8.0,3e-08,0.1,3000,1.01,72
28,8.0,3e-08,0.1,3000,1.3,72
29,8.0,3e-08,1.0,300,1.01,72
30,8.0,3e-08,1.0,300,1.3,72
31,8.0,3e-08,1.0,3000,1.01,72
32,8.0,3e-08,1.0,3000,1.3,72
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
Index,photocurrent,saturation_current,resistance_series,resistance_shunt,n,cells_in_series
1,0.5,1e-09,0.1,300,1.3,140
2,0.5,1e-09,0.1,300,1.5,140
3,0.5,1e-09,0.1,3000,1.3,140
4,0.5,1e-09,0.1,3000,1.5,140
5,0.5,1e-09,1.0,300,1.3,140
6,0.5,1e-09,1.0,300,1.5,140
7,0.5,1e-09,1.0,3000,1.3,140
8,0.5,1e-09,1.0,3000,1.5,140
9,0.5,1e-08,0.1,300,1.3,140
10,0.5,1e-08,0.1,300,1.5,140
11,0.5,1e-08,0.1,3000,1.3,140
12,0.5,1e-08,0.1,3000,1.5,140
13,0.5,1e-08,1.0,300,1.3,140
14,0.5,1e-08,1.0,300,1.5,140
15,0.5,1e-08,1.0,3000,1.3,140
16,0.5,1e-08,1.0,3000,1.5,140
17,2.5,1e-09,0.1,300,1.3,140
18,2.5,1e-09,0.1,300,1.5,140
19,2.5,1e-09,0.1,3000,1.3,140
20,2.5,1e-09,0.1,3000,1.5,140
21,2.5,1e-09,1.0,300,1.3,140
22,2.5,1e-09,1.0,300,1.5,140
23,2.5,1e-09,1.0,3000,1.3,140
24,2.5,1e-09,1.0,3000,1.5,140
25,2.5,1e-08,0.1,300,1.3,140
26,2.5,1e-08,0.1,300,1.5,140
27,2.5,1e-08,0.1,3000,1.3,140
28,2.5,1e-08,0.1,3000,1.5,140
29,2.5,1e-08,1.0,300,1.3,140
30,2.5,1e-08,1.0,300,1.5,140
31,2.5,1e-08,1.0,3000,1.3,140
32,2.5,1e-08,1.0,3000,1.5,140
Index,photocurrent,saturation_current,resistance_series,resistance_shunt,n,cells_in_series
1,0.5,1e-09,0.1,300,1.3,140
2,0.5,1e-09,0.1,300,1.5,140
3,0.5,1e-09,0.1,3000,1.3,140
4,0.5,1e-09,0.1,3000,1.5,140
5,0.5,1e-09,1.0,300,1.3,140
6,0.5,1e-09,1.0,300,1.5,140
7,0.5,1e-09,1.0,3000,1.3,140
8,0.5,1e-09,1.0,3000,1.5,140
9,0.5,1e-08,0.1,300,1.3,140
10,0.5,1e-08,0.1,300,1.5,140
11,0.5,1e-08,0.1,3000,1.3,140
12,0.5,1e-08,0.1,3000,1.5,140
13,0.5,1e-08,1.0,300,1.3,140
14,0.5,1e-08,1.0,300,1.5,140
15,0.5,1e-08,1.0,3000,1.3,140
16,0.5,1e-08,1.0,3000,1.5,140
17,2.5,1e-09,0.1,300,1.3,140
18,2.5,1e-09,0.1,300,1.5,140
19,2.5,1e-09,0.1,3000,1.3,140
20,2.5,1e-09,0.1,3000,1.5,140
21,2.5,1e-09,1.0,300,1.3,140
22,2.5,1e-09,1.0,300,1.5,140
23,2.5,1e-09,1.0,3000,1.3,140
24,2.5,1e-09,1.0,3000,1.5,140
25,2.5,1e-08,0.1,300,1.3,140
26,2.5,1e-08,0.1,300,1.5,140
27,2.5,1e-08,0.1,3000,1.3,140
28,2.5,1e-08,0.1,3000,1.5,140
29,2.5,1e-08,1.0,300,1.3,140
30,2.5,1e-08,1.0,300,1.5,140
31,2.5,1e-08,1.0,3000,1.3,140
32,2.5,1e-08,1.0,3000,1.5,140
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 11 additions & 6 deletions pvlib/tests/iotools/test_bsrn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
import os
import tempfile
from pvlib.iotools import read_bsrn, get_bsrn
from ..conftest import (DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal,
requires_bsrn_credentials)
from ..conftest import (
TESTS_DATA_DIR,
RERUNS,
RERUNS_DELAY,
assert_index_equal,
requires_bsrn_credentials,
)


@pytest.fixture(scope="module")
Expand All @@ -33,7 +38,7 @@ def expected_index():
('bsrn-lr0100-pay0616.dat'),
])
def test_read_bsrn(testfile, expected_index):
data, metadata = read_bsrn(DATA_DIR / testfile)
data, metadata = read_bsrn(TESTS_DATA_DIR / testfile)
assert_index_equal(expected_index, data.index)
assert 'ghi' in data.columns
assert 'dni_std' in data.columns
Expand All @@ -45,7 +50,7 @@ def test_read_bsrn(testfile, expected_index):
def test_read_bsrn_logical_records(expected_index):
# Test if logical records 0300 and 0500 are correct parsed
# and that 0100 is not passed when not specified
data, metadata = read_bsrn(DATA_DIR / 'bsrn-pay0616.dat.gz',
data, metadata = read_bsrn(TESTS_DATA_DIR / 'bsrn-pay0616.dat.gz',
logical_records=['0300', '0500'])
assert_index_equal(expected_index, data.index)
assert 'lwu' in data.columns
Expand All @@ -57,13 +62,13 @@ def test_read_bsrn_logical_records(expected_index):
def test_read_bsrn_bad_logical_record():
# Test if ValueError is raised if an unsupported logical record is passed
with pytest.raises(ValueError, match='not in'):
read_bsrn(DATA_DIR / 'bsrn-lr0100-pay0616.dat',
read_bsrn(TESTS_DATA_DIR / 'bsrn-lr0100-pay0616.dat',
logical_records=['dummy'])


def test_read_bsrn_logical_records_not_found():
# Test if an empty dataframe is returned if specified LRs are not present
data, metadata = read_bsrn(DATA_DIR / 'bsrn-lr0100-pay0616.dat',
data, metadata = read_bsrn(TESTS_DATA_DIR / 'bsrn-lr0100-pay0616.dat',
logical_records=['0300', '0500'])
assert data.empty # assert that the dataframe is empty
assert 'uva_global' in data.columns
Expand Down
6 changes: 3 additions & 3 deletions pvlib/tests/iotools/test_crn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numpy import dtype, nan
import pytest
from pvlib.iotools import crn
from ..conftest import DATA_DIR, assert_frame_equal, assert_index_equal
from ..conftest import TESTS_DATA_DIR, assert_frame_equal, assert_index_equal


@pytest.fixture
Expand Down Expand Up @@ -41,12 +41,12 @@ def dtypes():

@pytest.fixture
def testfile():
return DATA_DIR / 'CRNS0101-05-2019-AZ_Tucson_11_W.txt'
return TESTS_DATA_DIR / 'CRNS0101-05-2019-AZ_Tucson_11_W.txt'


@pytest.fixture
def testfile_problems():
return DATA_DIR / 'CRN_with_problems.txt'
return TESTS_DATA_DIR / 'CRN_with_problems.txt'


def test_read_crn(testfile, columns_mapped, dtypes):
Expand Down
4 changes: 2 additions & 2 deletions pvlib/tests/iotools/test_epw.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest

from pvlib.iotools import epw
from ..conftest import DATA_DIR, RERUNS, RERUNS_DELAY
from ..conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY

epw_testfile = DATA_DIR / 'NLD_Amsterdam062400_IWEC.epw'
epw_testfile = TESTS_DATA_DIR / 'NLD_Amsterdam062400_IWEC.epw'


def test_read_epw():
Expand Down
8 changes: 4 additions & 4 deletions pvlib/tests/iotools/test_midc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytz

from pvlib.iotools import midc
from ..conftest import DATA_DIR, RERUNS, RERUNS_DELAY
from ..conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY


@pytest.fixture
Expand All @@ -17,10 +17,10 @@ def test_mapping():
}


MIDC_TESTFILE = DATA_DIR / 'midc_20181014.txt'
MIDC_RAW_TESTFILE = DATA_DIR / 'midc_raw_20181018.txt'
MIDC_TESTFILE = TESTS_DATA_DIR / 'midc_20181014.txt'
MIDC_RAW_TESTFILE = TESTS_DATA_DIR / 'midc_raw_20181018.txt'
MIDC_RAW_SHORT_HEADER_TESTFILE = (
DATA_DIR / 'midc_raw_short_header_20191115.txt')
TESTS_DATA_DIR / 'midc_raw_short_header_20191115.txt')

# TODO: not used, remove?
# midc_network_testfile = ('https://midcdmz.nrel.gov/apps/data_api.pl'
Expand Down
6 changes: 3 additions & 3 deletions pvlib/tests/iotools/test_panond.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""

from pvlib.iotools import read_panond
from pvlib.tests.conftest import DATA_DIR
from pvlib.tests.conftest import TESTS_DATA_DIR

PAN_FILE = DATA_DIR / 'ET-M772BH550GL.PAN'
OND_FILE = DATA_DIR / 'CPS SCH275KTL-DO-US-800-250kW_275kVA_1.OND'
PAN_FILE = TESTS_DATA_DIR / 'ET-M772BH550GL.PAN'
OND_FILE = TESTS_DATA_DIR / 'CPS SCH275KTL-DO-US-800-250kW_275kVA_1.OND'


def test_read_panond():
Expand Down
11 changes: 5 additions & 6 deletions pvlib/tests/iotools/test_psm3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@

import os
from pvlib.iotools import psm3
from ..conftest import DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal
from ..conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal
import numpy as np
import pandas as pd
import pytest
from requests import HTTPError
from io import StringIO
import warnings
from pvlib._deprecation import pvlibDeprecationWarning

TMY_TEST_DATA = DATA_DIR / 'test_psm3_tmy-2017.csv'
YEAR_TEST_DATA = DATA_DIR / 'test_psm3_2017.csv'
YEAR_TEST_DATA_5MIN = DATA_DIR / 'test_psm3_2019_5min.csv'
MANUAL_TEST_DATA = DATA_DIR / 'test_read_psm3.csv'
TMY_TEST_DATA = TESTS_DATA_DIR / 'test_psm3_tmy-2017.csv'
YEAR_TEST_DATA = TESTS_DATA_DIR / 'test_psm3_2017.csv'
YEAR_TEST_DATA_5MIN = TESTS_DATA_DIR / 'test_psm3_2019_5min.csv'
MANUAL_TEST_DATA = TESTS_DATA_DIR / 'test_read_psm3.csv'
LATITUDE, LONGITUDE = 40.5137, -108.5449
METADATA_FIELDS = [
'Source', 'Location ID', 'City', 'State', 'Country', 'Latitude',
Expand Down
Loading