Skip to content

Commit

Permalink
Added files that will be used by notebook. refs #1
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Oct 6, 2020
1 parent 6dd2a00 commit cd525ea
Show file tree
Hide file tree
Showing 18 changed files with 4,029 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ dmypy.json

# Pyre type checker
.pyre/

# Mac
.DS_Store
.idea/
6 changes: 6 additions & 0 deletions notebooks/__code/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from qtpy.uic import loadUi

__all__ = ['load_ui']

def load_ui(ui_filename, baseinstance):
return loadUi(ui_filename, baseinstance=baseinstance)
23 changes: 23 additions & 0 deletions notebooks/__code/array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import numpy as np


def exclude_y_value_when_error_is_nan(axis, error_axis):
axis_cleaned = []
error_axis_cleaned = []

for _x, _error in zip(axis, error_axis):
if (_x == "None") or (_error == "None") or (_x is None) or (_error is None):
axis_cleaned.append(np.NaN)
error_axis_cleaned.append(np.NaN)
else:
axis_cleaned.append(np.float(_x))
error_axis_cleaned.append(np.float(_error))

return axis_cleaned, error_axis_cleaned


def check_size(x_axis=None, y_axis=None):
size_x = len(x_axis)
size_y = len(y_axis)
min_len = np.min([size_x, size_y])
return x_axis[:min_len], y_axis[:min_len]
Loading

0 comments on commit cd525ea

Please sign in to comment.