diff --git a/.gitignore b/.gitignore index 025ee34a..ad76ea59 100644 --- a/.gitignore +++ b/.gitignore @@ -297,3 +297,29 @@ bh_unicode_properties.cache GitHub.sublime-settings # End of https://www.gitignore.io/api/data,macos,python,pycharm,database,sublimetext,jupyternotebook + +# Created by https://www.toptal.com/developers/gitignore/api/vim +# Edit at https://www.toptal.com/developers/gitignore?templates=vim + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# End of https://www.toptal.com/developers/gitignore/api/vim diff --git a/README.md b/README.md index 5857d991..7a9dfff7 100644 --- a/README.md +++ b/README.md @@ -93,9 +93,16 @@ See [notebooks](/notebooks) folder for examples. ### 3 ways of setting up, either approach works: -#### 1) Recommended: Set up `conda` environment with provided `.yml` file +#### 1) Recommended: Install with pip -We recommend setting up a fresh Python virtual environment in which to use `solar-data-tools`. We recommend using the [Conda](https://docs.conda.io/projects/conda/en/latest/index.html) package management system, and creating an environment with the environment configuration file named `pvi-user.yml`, provided in the top level of this repository. This will install the `statistical-clear-sky` package as well. +In a fresh Python virtual environment, simply run + + +```bash +$ pip install solar-data-tools +``` + +#### 2) Creat conda virtual environment from file Creating the env: @@ -123,32 +130,17 @@ $ conda env update -f pvi-user.yml Additional documentation on setting up the Conda environment is available [here](https://github.com/slacgismo/pvinsight-onboarding/blob/main/README.md). - -#### 2) PIP Package - -```sh -$ pip install solar-data-tools -``` - -Alternative: Clone repo from GitHub - -Mimic the pip package by setting up locally. - -```bash -$ pip install -e path/to/root/folder -``` - -#### 3) Anaconda Package +#### 3) General Anaconda Package ```sh -$ conda install -c slacgismo solar-data-tools +$ conda install slacgismo::solar-data-tools ``` ### Solvers -#### QSS & OSQP +#### QSS & CLARABEL -By default, [QSS](https://github.com/cvxgrp/qss) and OSQP solvers are used for non-convex and convex problems, respectively. Both are supported by [OSD](https://github.com/cvxgrp/signal-decomposition/tree/main), the modeling language used to solve signal decomposition problems in Solar Data Tools, and both are open source. +By default, [QSS](https://github.com/cvxgrp/qss) and CLARABEL solvers are used for non-convex and convex problems, respectively. Both are supported by [OSD](https://github.com/cvxgrp/signal-decomposition/tree/main), the modeling language used to solve signal decomposition problems in Solar Data Tools, and both are open source. #### MOSEK diff --git a/solardatatools/data_handler.py b/solardatatools/data_handler.py index a50cc997..f7cf2cb2 100644 --- a/solardatatools/data_handler.py +++ b/solardatatools/data_handler.py @@ -1141,11 +1141,6 @@ def rescale_signal(signal, minimum, maximum): use_ixs = self.daily_flags.clear else: use_ixs = self.daily_flags.no_errors - ### NEW 3/20/24: overwrite use of qss on this function. Forcing CLARABEL here uses the old-style - # iteratively reweighted model, rather than the nonconvex piecewise constant model. In testing, - # the older model (which is not technically covered by the monograph) seems to work better. - if solver != "MOSEK": - solver = "CLARABEL" ########## Updates to timeshift algorithm, 6/2023 ########## # If running with any solver other than QSS: solve convex problem # If running with QSS without a set w1: run w1 meta-opt with convex problem, diff --git a/solardatatools/signal_decompositions.py b/solardatatools/signal_decompositions.py index 75f7c740..1a102668 100644 --- a/solardatatools/signal_decompositions.py +++ b/solardatatools/signal_decompositions.py @@ -93,6 +93,7 @@ def l2_l1d1_l2d2p365( yearly_periodic=yearly_periodic, return_all=return_all, transition_locs=transition_locs, + solver=solver, verbose=verbose, ) elif yearly_periodic: @@ -172,6 +173,7 @@ def tl1_l2d2p365( w1=w1, yearly_periodic=yearly_periodic, return_all=return_all, + solver=solver, verbose=verbose, ) else: @@ -226,7 +228,8 @@ def l1_l1d1_l2d2p365( if solver == "MOSEK": # MOSEK weights set in CVXPY function res = _cvx_l1_l1d1_l2d2p365( - signal=signal, use_ixs=use_ixs, return_all=return_all, verbose=verbose + signal=signal, use_ixs=use_ixs, return_all=return_all, + solver=solver, verbose=verbose ) else: res = _osd_l1_l1d1_l2d2p365( @@ -264,7 +267,8 @@ def l2_l1d2_constrained( """ if solver == "MOSEK": # MOSEK weights set in CVXPY function - res = _cvx_l2_l1d2_constrained(signal, return_all=return_all, verbose=verbose) + res = _cvx_l2_l1d2_constrained(signal, return_all=return_all, + solver=solver, verbose=verbose) else: res = _osd_l2_l1d2_constrained( signal, w0=w0, w1=w1, return_all=return_all, solver=solver, verbose=verbose