Skip to content

Commit

Permalink
Version bump: 3.0.1 -> 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kessler authored and Kessler committed May 30, 2019
1 parent 5a67ff5 commit f5f544a
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ecnet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from ecnet.server import Server
__version__ = '3.0.1'
__version__ = '3.1.0'
2 changes: 1 addition & 1 deletion ecnet/models/mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/models/mlp.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains the "MultilayerPerceptron" (feed-forward neural network) class
Expand Down
4 changes: 2 additions & 2 deletions ecnet/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# -*- coding: utf-8 -*-
#
# ecnet/server.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains the "Server" class, which handles ECNet project creation, neural
# network model creation, data hand-off to models, prediction error
# calculation, input parameter selection, hyperparameter tuning.
#
# For example scripts, refer to https://github.com/ecrl/ecnet/examples
# For example scripts, refer to https://ecnet.readthedocs.io/en/latest/
#

# ECNet imports
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tasks/limit_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tasks/limit_inputs.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions for selecting influential input parameters
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tasks/remove_outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tasks/remove_outliers.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains function for removing outliers from ECNet DataFrame
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tasks/tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tasks/tuning.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions/fitness functions for tuning hyperparameters
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tools/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tools/conversions.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions for converting various chemical file formats
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tools/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tools/database.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions for creating ECNet-formatted databases
Expand Down
56 changes: 55 additions & 1 deletion ecnet/tools/plotting.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ecnet/tools/plotting.py
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions/classes for creating various plots
#

# stdlib. imports
from math import sqrt

# 3rd party imports
from matplotlib import pyplot as plt
from matplotlib.offsetbox import AnchoredText
from math import sqrt


class ParityPlot:

def __init__(self, title='Parity Plot', x_label='Experimental Value',
y_label='Predicted Value', font='Times New Roman'):
''' ParityPlot: creates a plot of predicted values vs. experimental
data relative to a 1:1 parity line
Args:
title (str): title of the plot
x_label (str): x-axis label for the plot
y_label (str): y-axis label for the plot
font (str): font for the plot
'''

plt.rcParams['font.family'] = font
plt.title(title)
Expand All @@ -16,6 +38,14 @@ def __init__(self, title='Parity Plot', x_label='Experimental Value',
self._labels = None

def add_series(self, x_vals, y_vals, name=None, color=None):
''' Adds data to the plot
Args:
x_vals (iter): x values for the series
y_vals (iter): y values for the series (same length as x_vals)
name (str): if not None, names the series and places legend
color (str): if not None, uses specified color to denote series
'''

if len(x_vals) != len(y_vals):
raise ValueError('Length of supplied X and Y values are not equal:'
Expand All @@ -30,23 +60,41 @@ def add_series(self, x_vals, y_vals, name=None, color=None):
self._max_val = y_max

def add_error_bars(self, error, label=None):
''' Adds error bars, +/- the error relative to the 1:1 parity line
Args:
error (int, float): error value
label (str): if not None, adds the name/value to the legend
'''

self._add_parity_line(offset=error)
self._add_parity_line(offset=(-1 * error))
if label is not None:
self._add_label(label, error)

def show(self):
''' Shows the plot on-screen '''

self._add_parity_line()
plt.show()

def save(self, filename):
''' Saves the plot to a file
Args:
filename (str): path to desired save location/file
'''

self._add_parity_line()
plt.savefig(filename)

def _add_parity_line(self, offset=0):
''' Adds a 1:1 parity line
Args:
offset (int, float): if not 0, adds a +/- offset relative to y=0
when x=0 parity line
'''

if offset < 0:
direction = -1
Expand All @@ -63,6 +111,12 @@ def _add_parity_line(self, offset=0):
)

def _add_label(self, label, value):
''' Adds a label and value to the plot's legend
Args:
label (str): name of the label
value (int, float): value of the label
'''

string = '{}: '.format(label) + '%.3f' % value
if self._labels is None:
Expand Down
2 changes: 1 addition & 1 deletion ecnet/tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/tools/project.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions for predicting data using pre-existing .prj files
Expand Down
2 changes: 1 addition & 1 deletion ecnet/utils/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/utils/data_utils.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions/classes for loading data, saving data, saving results
Expand Down
2 changes: 1 addition & 1 deletion ecnet/utils/error_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/utils/error_utils.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions for error calculations
Expand Down
2 changes: 1 addition & 1 deletion ecnet/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/utils/logging.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains logger used by ECNet
Expand Down
2 changes: 1 addition & 1 deletion ecnet/utils/server_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# ecnet/utils/server_utils.py
# v.3.0.1
# v.3.1.0
# Developed in 2019 by Travis Kessler <[email protected]>
#
# Contains functions used by ecnet.Server
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='ecnet',
version='3.0.1',
version='3.1.0',
description='UMass Lowell Energy and Combustion Research Laboratory Neural'
' Network Software',
url='http://github.com/tjkessler/ecnet',
Expand Down

0 comments on commit f5f544a

Please sign in to comment.