Skip to content

Commit

Permalink
Merge pull request #80 from slacgismo/update/remove-review
Browse files Browse the repository at this point in the history
Update/remove review
  • Loading branch information
bmeyers committed Jun 23, 2022
2 parents fa43122 + c600914 commit 9b4682e
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 95 deletions.
70 changes: 0 additions & 70 deletions .github/workflows/build-test.yml

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Deploy Main
on:
push:
branches:
- master
release:
types: [published]
jobs:
deploy-pypi:
runs-on: ubuntu-latest
Expand All @@ -13,8 +12,6 @@ jobs:

- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.7'

- name: Install Twine
run: sudo pip install twine
Expand Down Expand Up @@ -59,12 +56,11 @@ jobs:
- name: Build the Anaconda Package
id: condabuild
run: |
conda install anaconda-client
conda install anaconda-client
conda config --set anaconda_upload no
echo yes | anaconda login --username ${{ secrets.ANACONDA_CLOUD_USERNAME }} --password ${{ secrets.ANACONDA_CLOUD_PASSWORD }}
git fetch --prune --unshallow --tags
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c slacgismo --numpy 1.16.4
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge -c slacgismo --numpy 1.22.0
echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)'
- name: Upload the Anaconda Package
Expand Down
61 changes: 58 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Tests
on: [push]
jobs:
test-build:
run-tests:
runs-on: ubuntu-latest
environment: test
steps:
Expand All @@ -18,8 +18,6 @@ jobs:

- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.7'

- name: Install Dependencies
run: |
Expand All @@ -36,3 +34,60 @@ jobs:
# Current unit test is not consistent. Occasionally fails despite usually passing. Needs to be fixed.
- name: Run Unit Tests
run: sudo coverage run -m unittest

build-pypi:
runs-on: ubuntu-latest
needs: run-tests
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Python
uses: actions/setup-python@v3

- name: Install Twine
run: sudo pip install twine

- name: Create the distribution
run: |
git fetch --prune --unshallow --tags
sudo python setup.py sdist bdist_wheel
build-conda:
runs-on: ubuntu-latest
needs: run-tests
# sets default shell to remove need for source to run the conda shell
defaults:
run:
shell: bash -l {0}
environment: test-deployment
steps:
- name: Checkout Repository
uses: actions/checkout@v3

# Much better than manual installation, original version Miniconda2-4.7.10-Linux-x86_64.sh is broken
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
miniconda-version: "latest"

- name: Install the Conda Dependencies
run: |
conda config --set always_yes yes --set auto_update_conda false
conda update conda
conda install conda-build
# run install twice due to client-size to ensure all files downloaded
# echo yes before login to prevent anaconda bug breaking automation
# git tags MUST be fetched otherwise output will be blank
# bash variables cannot be used in github actions, must use actions specific syntax and methods
- name: Build the Anaconda Package
id: condabuild
run: |
conda install anaconda-client
conda config --set anaconda_upload no
git fetch --prune --unshallow --tags
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)test conda build . -c conda-forge -c slacgismo --numpy 1.22.0
echo '::set-output name=gitversion::$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<img src="https://readthedocs.org/projects/solar-data-tools/badge/?version=stable" alt="documentation build status" />
</a>
<a href="https://github.com/slacgismo/solar-data-tools/actions/workflows/test.yml">
<img src="https://github.com/slacgismo/solar-data-tools/actions/workflows/test.yml/badge.svg?branch=master&event=workflow_run" alt="Actions build status" />
<img src="https://github.com/slacgismo/solar-data-tools/actions/workflows/test.yml/badge.svg?branch=master" alt="Actions build status" />
</a>
<!-- switch below from tadatoshi to gismo -->
<a href="https://travis-ci.com/tadatoshi/solar-data-tools.svg?branch=development">
Expand Down
4 changes: 2 additions & 2 deletions conda_recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ requirements:
- pip
- python
- scipy
- numpy >=1.16
- numpy >=1.22
- pandas
- seaborn
- requests

run:
- scipy
- numpy >=1.16
- numpy >=1.22
- pandas
- seaborn
- requests
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scipy
numpy==1.19.2
numpy>=1.22.0
pandas
scikit-learn
jupyter
Expand Down
2 changes: 1 addition & 1 deletion solardatatools/algorithms/capacity_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run(
solver=None,
):
if filter is None:
filter = np.ones(data.shape[1], dtype=np.bool)
filter = np.ones(data.shape[1], dtype=bool)
if np.sum(filter) > 0:
metric = np.nanquantile(data, q=quantile, axis=0)
# metric = np.sum(data, axis=0)
Expand Down
2 changes: 1 addition & 1 deletion solardatatools/algorithms/clipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def pointmass_detection(
):
point_masses[-2] = True
# Reduce clusters of detected points to single points
pm_reduce = np.zeros_like(point_masses, dtype=np.bool)
pm_reduce = np.zeros_like(point_masses, dtype=bool)
for ix in range(len(point_masses) - 1):
if ~point_masses[ix] and point_masses[ix + 1]:
begin_cluster = ix + 1
Expand Down
4 changes: 2 additions & 2 deletions solardatatools/algorithms/soiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def soiling_seperation(
index_set = ~np.isnan(observed)
else:
index_set = np.logical_and(index_set, ~np.isnan(observed))
# zero_set = np.zeros(len(observed) - 1, dtype=np.bool)
# zero_set = np.zeros(len(observed) - 1, dtype=bool)
eps = 0.01
n = len(observed)
s1 = cvx.Variable(n) # soiling
Expand Down Expand Up @@ -215,7 +215,7 @@ def soiling_seperation_old(
index_set = ~np.isnan(observed)
else:
index_set = np.logical_and(index_set, ~np.isnan(observed))
# zero_set = np.zeros(len(observed) - 1, dtype=np.bool)
# zero_set = np.zeros(len(observed) - 1, dtype=bool)
eps = 0.01
n = len(observed)
s1 = cvx.Variable(n) # soiling
Expand Down
8 changes: 4 additions & 4 deletions solardatatools/algorithms/sunrise_sunset_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ def run_optimizer(
train_ss = use_set_ss[:split_at_ss]
test_sr = use_set_sr[split_at_sr:]
test_ss = use_set_ss[split_at_ss:]
train_msk_sr = np.zeros_like(sunrises, dtype=np.bool)
train_msk_ss = np.zeros_like(sunsets, dtype=np.bool)
train_msk_sr = np.zeros_like(sunrises, dtype=bool)
train_msk_ss = np.zeros_like(sunsets, dtype=bool)
train_msk_sr[train_sr] = True
train_msk_ss[train_ss] = True
test_msk_sr = np.zeros_like(sunrises, dtype=np.bool)
test_msk_ss = np.zeros_like(sunsets, dtype=np.bool)
test_msk_sr = np.zeros_like(sunrises, dtype=bool)
test_msk_ss = np.zeros_like(sunsets, dtype=bool)
test_msk_sr[test_sr] = True
test_msk_ss[test_ss] = True
sr_smoothed = tl1_l2d2p365(
Expand Down
2 changes: 1 addition & 1 deletion solardatatools/data_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def make_linearity_scores(data_matrix, capacity, density_baseline):
n * density_baseline
)
# Label detected infill points with a boolean mask
infill = np.zeros_like(data_matrix, dtype=np.bool)
infill = np.zeros_like(data_matrix, dtype=bool)
slct = linearity_scores >= 0.1
reference_diffs = np.tile(modes[0][slct], (data_matrix.shape[0], 1))
found_infill = np.logical_or(
Expand Down
2 changes: 1 addition & 1 deletion solardatatools/daytime.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def find_daytime(data_matrix, threshold=0.01):

def detect_sun(data, threshold):
scaled_mat = scale_data(data)
bool_msk = np.zeros_like(scaled_mat, dtype=np.bool)
bool_msk = np.zeros_like(scaled_mat, dtype=bool)
slct = ~np.isnan(scaled_mat)
bool_msk[slct] = scaled_mat[slct] > threshold
return bool_msk
Expand Down
2 changes: 1 addition & 1 deletion solardatatools/signal_decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def tl1_l1d1_l2d2p365(
if tv_weights is None:
tv_weights = np.ones(len(signal) - 1)
if use_ixs is None:
use_ixs = np.ones(n, dtype=np.bool)
use_ixs = np.ones(n, dtype=bool)
# selected_days = np.arange(n)[index_set]
# np.random.shuffle(selected_days)
# ix = 2 * n // 3
Expand Down

0 comments on commit 9b4682e

Please sign in to comment.