Skip to content

Commit 856dc07

Browse files
Merge pull request #32 from sandialabs/restructure_modules
Restructure modules
2 parents f762dcb + fde5c4a commit 856dc07

23 files changed

+1563
-705
lines changed

NOTICE/statsmodels_LICENSE

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Copyright (C) 2006, Jonathan E. Taylor
2+
All rights reserved.
3+
4+
Copyright (c) 2006-2008 Scipy Developers.
5+
All rights reserved.
6+
7+
Copyright (c) 2009-2018 statsmodels Developers.
8+
All rights reserved.
9+
10+
11+
Redistribution and use in source and binary forms, with or without
12+
modification, are permitted provided that the following conditions are met:
13+
14+
a. Redistributions of source code must retain the above copyright notice,
15+
this list of conditions and the following disclaimer.
16+
b. Redistributions in binary form must reproduce the above copyright
17+
notice, this list of conditions and the following disclaimer in the
18+
documentation and/or other materials provided with the distribution.
19+
c. Neither the name of statsmodels nor the names of its contributors
20+
may be used to endorse or promote products derived from this software
21+
without specific prior written permission.
22+
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27+
ARE DISCLAIMED. IN NO EVENT SHALL STATSMODELS OR CONTRIBUTORS BE LIABLE FOR
28+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
34+
DAMAGE.

docs/whatsnew.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ What's New
66

77
These are new features and improvements of note in each release.
88

9-
.. include:: whatsnew/beta.rst
9+
10+
.. include:: whatsnew/beta.rst
11+
12+
.. include:: whatsnew/alpha.rst

docs/whatsnew/alpha.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _whatsnew_alpha:
2+
3+
First push
4+
-----------------------
5+
6+
The original release of pvOps consists mostly of new features.
7+
8+
New features
9+
~~~~~~~~~~~~
10+
11+
* `text` module added which conducts natural language processing on Operations & Maintenance (O&M) tickets, or other.
12+
* `text2time` module investigates the relationship between the production timeseries data and the O&M tickets.
13+
* `timeseries` module conducts timeseries preprocessing and modeling
14+
* `iv` incorporates the ability to simulate current-voltage (IV) curves under different environmental, load, and failure conditions.
15+
16+
17+
Documentation
18+
~~~~~~~~~~~~~
19+
20+
* Built original website
21+
* Add whatsnew
22+
* Add jupyter notebook embeddings
23+
24+
Testing
25+
~~~~~~~
26+
27+
* Built comprehensive tests with pytest
28+
* Connected tests to automated testing pipeline

docs/whatsnew/beta.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,22 @@
33
beta
44
-----------------------
55

6-
The beta release of pvOps will consist mostly of new features.
6+
New features and bug fixes are predominant in the beta versions.
77

88
New features
99
~~~~~~~~~~~~
1010

11-
* `text` module added which conducts natural language processing on Operations & Maintenance (O&M) tickets, or other.
12-
* `text2time` module investigates the relationship between the production timeseries data and the O&M tickets.
13-
* `timeseries` module conducts timeseries preprocessing and modeling
14-
* `iv` incorporates the ability to simulate current-voltage (IV) curves under different environmental, load, and failure conditions.
11+
* IV trace classification framework built according to literature (PR #25)
12+
* Timeseries IV simulation for highly customizable degradation of system parameters (PR #28)
13+
* Leverage pvlib solarposition package to populate content per site (PR #32)
14+
* Add coefficient-level evaluations linear models (PR #32)
15+
* Give user ability to input own test-train splits to linear modeller (PR #32)
16+
* Remap attributes function must retain the unaltered attributes (PR #32)
17+
* Interpolate O&M data onto production data where overlaps exist (PR #32)
1518

19+
Bug fixes
20+
~~~~~~~~~
1621

17-
Documentation
18-
~~~~~~~~~~~~~
19-
20-
* Built original website
21-
* Add whatsnew
22-
* Add jupyter notebook embeddings
23-
24-
Testing
25-
~~~~~~~
26-
27-
* Built comprehensive tests with pytest
28-
* Connected tests to automated testing pipeline
22+
* Basic package fixes to README (PR #27) and documentation configuration (PR #24)
23+
* Fix IV simulator bug for edge case where two IV curves added have equal I_{sc} (PR #30)
24+
* Neural network configuration referencing in 1D CNN (PR #32)

examples/example_data/remappings_asset.csv

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
in,out_
2-
Inverter,inverter
3-
Recloser,recloser
4-
Transformer,transformer
5-
Switchgear,switchgear
6-
Combiner,combiner
2+
inverter,inverter
3+
recloser,recloser
4+
transformer,transformer
5+
switchgear,switchgear
6+
combiner,combiner
7+
substation,substation
8+
facility,facility
9+
energy meter,energy meter
10+
relay,relay
11+
met station,met station
12+
tracker,tracker
13+
module,module
714
DC Disconnect,combiner
815
Recombiner,combiner
916
Feeder (Dip Pole/Array),wiring
1017
Ground-Mount PV System,module
11-
Module,module
12-
Tracker,tracker
13-
Met station,met station
1418
Weather Station,met station
1519
Pyranometer,met station
1620
Temperature sensor,met station
1721
Met station battery,met station
1822
Anemometer,met station
1923
Reference cell,met station
2024
Relative humidity sensor,met station
21-
Relay,relay
22-
Energy Meter,energy meter
2325
Meter,energy meter
2426
Energy Storage/Battery,energy storage
25-
Facility,facility
2627
AC Combiner,combiner
2728
Battery (Solar + storage facilities),energy storage
2829
Block,transformer
@@ -49,7 +50,6 @@ Site,other
4950
String,other
5051
String Inverter,inverter
5152
Subarray,other
52-
Substation,substation
5353
Summary,other
5454
Tracker control unit,tracker
5555
Tracking System,tracker
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
in,out_
2+
Remote Troubleshooting,Remote troubleshotting/Reset
3+
Remote Reset,Remote troubleshotting/Reset
4+
13 - Remote Reset,Remote troubleshotting/Reset
5+
Power Cycle,Troubleshoot/Reset
6+
07 - Service,Troubleshoot/Reset
7+
09 - Inspection,Troubleshoot/Reset
8+
09-Inspection,Troubleshoot/Reset
9+
06 - Check,Troubleshoot/Reset
10+
08 - Test,Troubleshoot/Reset
11+
Clear faults,Troubleshoot/Reset
12+
Faults cleared,Troubleshoot/Reset
13+
Fault cleared manually,Troubleshoot/Reset
14+
No Action Required,Self-Resolved
15+
Problem Self-Resolved,Self-Resolved
16+
14 - Self Resolved,Self-Resolved
17+
Hardware Replacement,Replacement
18+
Replacement,Replacement
19+
01 - Replace,Replacement
20+
Fuse Replacement,Replacement
21+
Replace/Repair,Replacement

examples/text_class_example.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, df, LABEL_COLUMN):
4343
self.df = df
4444

4545
def summarize_text_data(self, DATA_COLUMN):
46-
utils.summarize_text_data(self.df, DATA_COLUMN)
46+
nlp_utils.summarize_text_data(self.df, DATA_COLUMN)
4747

4848
def visualize_attribute_timeseries(self, DATE_COLUMN):
4949
col_dict = {"date": DATE_COLUMN, "label": self.LABEL_COLUMN}
@@ -102,6 +102,8 @@ def prep_data_for_ML(
102102
EVENTSTART_COLUMN,
103103
SAVE_DATA_COLUMN="CleanDesc",
104104
SAVE_DATE_COLUMN="ExtractedDates",
105+
input_lst_add_stopwords=None,
106+
input_lst_keep_stopwords=None,
105107
):
106108
self.DATA_COLUMN = DATA_COLUMN
107109
self.EVENTSTART_COLUMN = EVENTSTART_COLUMN
@@ -115,13 +117,23 @@ def prep_data_for_ML(
115117
self.df = self.df[self.df[self.LABEL_COLUMN] != lbl]
116118
self.df = self.df.sample(frac=1)
117119

120+
lst_add_stopwords = ["dtype", "say", "new",
121+
"length", "object", "u", "ha", "wa"]
122+
lst_keep_words = ["new"]
123+
if not isinstance(input_lst_add_stopwords, type(None)):
124+
lst_add_stopwords += input_lst_add_stopwords
125+
if not isinstance(input_lst_keep_stopwords, type(None)):
126+
lst_keep_words += input_lst_keep_stopwords
127+
118128
lst_stopwords = nlp_utils.create_stopwords(
119129
["english"],
120-
lst_add_words=["dtype", "say", "new",
121-
"length", "object", "u", "ha", "wa"],
122-
lst_keep_words=["new"],
130+
lst_add_words=lst_add_stopwords,
131+
lst_keep_words=lst_keep_words,
123132
)
124133

134+
# Save so that can be easily referenced
135+
self.lst_stopwords = lst_stopwords
136+
125137
col_dict = {
126138
"data": DATA_COLUMN,
127139
"eventstart": EVENTSTART_COLUMN,
@@ -140,9 +152,8 @@ def prep_data_for_ML(
140152
self.DATA_COLUMN = SAVE_DATA_COLUMN
141153
return self.df[[DATA_COLUMN, SAVE_DATA_COLUMN]]
142154

143-
def visualize_freqPlot(self, LBL_CAT=None, DATA_COLUMN="CleanDesc",
155+
def visualize_freqPlot(self, LBL_CAT=None, DATA_COLUMN="CleanDesc",
144156
**graph_aargs):
145-
146157
if LBL_CAT is None:
147158
words = " ".join(self.df[DATA_COLUMN].tolist())
148159
num_rows = len(self.df[DATA_COLUMN].index)
@@ -269,15 +280,15 @@ def classify_supervised(
269280
user_defined_search_space=None,
270281
verbose=0,
271282
):
272-
"""A wrapper function which evaluates the performance of many
283+
"""A wrapper function which evaluates the performance of many
273284
supervised classifiers
274285
275286
embedding : str
276-
Definition of document embedding strategy with "tfidf" and
287+
Definition of document embedding strategy with "tfidf" and
277288
"doc2vec" options
278289
279290
setting : str
280-
Thoroughness of supervised classification investigation with
291+
Thoroughness of supervised classification investigation with
281292
following options:
282293
'normal': a smaller subset of settings used in grid search
283294
'detailed': a comprehensive set of settings used in grid search

examples/tutorial_text2time_module.ipynb

Lines changed: 30 additions & 27 deletions
Large diffs are not rendered by default.

examples/tutorial_textmodule.ipynb

Lines changed: 241 additions & 265 deletions
Large diffs are not rendered by default.

examples/tutorial_timeseries.ipynb

Lines changed: 107 additions & 31 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)