diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1a2334db..902da4d2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,30 +25,30 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Print triggering event info run: | echo "${{ github.actor }} triggered run #${{ github.run_number }} with event type ${{ github.event_name }}" - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_NREL_USER }} password: ${{ secrets.DOCKERHUB_NREL_TOKEN }} - name: Login to GitHub Package Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: ./docker/Dockerfile diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 81275235..9c903f82 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -1,4 +1,4 @@ -name: test +name: test on: [pull_request, push] @@ -60,7 +60,7 @@ jobs: echo "/home/runner/work/bifacial_radiance/bifacial_radiance/SMARTS_295_Linux" >> $GITHUB_PATH - name: Test with pytest ${{ matrix.env }} - uses: coactions/setup-xvfb@v1 # GUI testing requires xvfb + uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a # GUI testing requires xvfb with: run: | pytest --cov=bifacial_radiance diff --git a/bifacial_radiance/main.py b/bifacial_radiance/main.py index 93d52dfb..28faddc7 100644 --- a/bifacial_radiance/main.py +++ b/bifacial_radiance/main.py @@ -1141,12 +1141,22 @@ def _saveTempTMY(self, tmydata, filename=None, starttime=None, endtime=None, elif coerce_year is None: coerce_year = 2021 print(f"Coercing year to {coerce_year}") - with warnings.catch_warnings(): - warnings.simplefilter("ignore") - tmydata.index.values[:] = tmydata.index[:] + pd.DateOffset(year=(coerce_year)) - # Correcting last index to next year. - tmydata.index.values[-1] = tmydata.index[-1] + pd.DateOffset(year=(coerce_year+1)) - + #with warnings.catch_warnings(): + # warnings.simplefilter("ignore") # can't get rid of vectorized + #tmydata.index.values[:] = tmydata.index[:] + pd.DateOffset(year=(coerce_year)) + #tmydata.index.values[-1] = tmydata.index[-1] + pd.DateOffset(year=(coerce_year+1)) + tz = tmydata.index.tz + year_vector = np.full(shape=tmydata.__len__(), fill_value=coerce_year) + year_vector[-1] = coerce_year+1 + tmydata.index = pd.to_datetime({ + 'year': year_vector, + 'month': tmydata.index.month, + 'day': tmydata.index.day, + 'hour': tmydata.index.hour}) + tmydata = tmydata.tz_localize(tz) + + + # FilterDates filterdates = None if starttime is not None and endtime is not None: diff --git a/docs/sphinx/source/whatsnew/pending.rst b/docs/sphinx/source/whatsnew/pending.rst index 9c4e0faa..ebca08c8 100644 --- a/docs/sphinx/source/whatsnew/pending.rst +++ b/docs/sphinx/source/whatsnew/pending.rst @@ -47,6 +47,8 @@ Bug fixes * Numpy 2.0 compatibility bug (:issue:`521`) * Fixed bug in :func:`bifacial_radiance.mismatch.mismatch_fit3` where the function was not returning the correct values. It has also been deprecated in favour of :func:`bifacial_radiance.mismatch.mismatch_fit2` which has a greater agreement with anual energy yield data (:issue:`520`) * Fixed typo on Opacity calculation factor (:issue:`426`) +* Updated Github Actions to use Node20: checkout@v4, setup-python@v5, coactions/setup-xvfb, setup-buildx-action@v3 (:pull:`517`) +* Fix PerformanceWarning and SettingWithCopyWarning (:issue:`515`) Documentation ~~~~~~~~~~~~~~