Skip to content

Commit

Permalink
Merge branch 'dev' into spcqe_quantiles
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeyers authored Mar 21, 2024
2 parents 995e5dd + f2a6165 commit 5276131
Show file tree
Hide file tree
Showing 8 changed files with 907 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install the Conda Dependencies
run: |
conda config --set always_yes yes --set auto_update_conda false
conda update conda
conda install conda=24.1.2
conda install -n base conda-libmamba-solver
conda install python=3.10 conda-build colorama pip ruamel ruamel.yaml rich jsonschema -c conda-forge
git fetch --prune --unshallow --tags
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install the Conda Dependencies
run: |
conda config --set always_yes yes --set auto_update_conda false
conda update conda
conda install conda=24.1.2
conda install -n base conda-libmamba-solver
conda install python=3.10 conda-build colorama pip ruamel ruamel.yaml rich jsonschema -c conda-forge
git fetch --prune --unshallow --tags
Expand Down
3 changes: 1 addition & 2 deletions pvsystemprofiler/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@ def __init__(
solar_noon_method == "optimized_estimates"
or daylight_method == "optimized_estimates"
):
ss = SunriseSunset()
ss = self.data_handler.daytime_analysis

if solar_noon_method == "rise_set_average":
self.solarnoon = avg_sunrise_sunset(self.data_matrix)
elif solar_noon_method == "energy_com":
self.solarnoon = energy_com(self.data_matrix)
if solar_noon_method == "optimized_estimates":
ss.run_optimizer(data=self.data_matrix)
self.solarnoon = np.nanmean(
[ss.sunrise_estimates, ss.sunset_estimates], axis=0
)
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ sig-decomp
osqp
clarabel
qss
tqdm
spcqe
1 change: 1 addition & 0 deletions solardatatools/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from solardatatools.algorithms.soiling import soiling_seperation_old
from solardatatools.algorithms.soiling import soiling_seperation
from solardatatools.algorithms.dilatation import Dilatation
from solardatatools.algorithms.loss_factor_analysis import LossFactorAnalysis
23 changes: 11 additions & 12 deletions solardatatools/algorithms/capacity_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(
quantile=1.00,
w1=40e-6, # scaled weights for QSS
w2=6561e-6,
solver=None
solver=None,
):
if filter is None:
filter = np.ones(data.shape[1], dtype=bool)
Expand All @@ -43,24 +43,23 @@ def run(
metric /= np.max(metric)

s1, s2, s3 = l1_l1d1_l2d2p365(
metric,
use_ixs=filter,
w1=w1,
w2=w2,
solver=solver,
sum_card=True
metric, use_ixs=filter, w1=w1, w2=w2, solver=solver, sum_card=True
)
else:
# print('No valid values! Please check your data and filter.')
return

# Get capacity assignments
rounded_s1 = np.round(s1, 1)
def custom_round(x, base=0.05):
ndigits = len(str(base).split(".")[-1])
return np.round(base * np.round(x / base), ndigits)

rounded_s1 = custom_round(s1)
set_labels = list(set(rounded_s1))
capacity_assignments = [set_labels.index(i) for i in rounded_s1]

self.metric = metric
self.s1 = s1 # pwc
self.s2 = s2 # seasonal
self.s3 = s3 # linear
self.labels = capacity_assignments
self.s1 = s1 # pwc
self.s2 = s2 # seasonal
self.s3 = s3 # linear
self.labels = capacity_assignments
Loading

0 comments on commit 5276131

Please sign in to comment.