Skip to content

Commit

Permalink
Import improvements, bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manuvarkey committed Jun 16, 2022
1 parent 5fc705f commit 42750de
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Earth design simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
],
"source": [
"from math import sqrt, log, pi, ceil, floor\n",
"\n",
"import numpy as np\n",
"from numpy.linalg import norm, solve\n",
"import matplotlib.pyplot as plt\n",
"plt.rcParams[\"font.family\"] = \"Ubuntu Mono\"\n",
"plt.rcParams['font.size'] = 9\n",
Expand All @@ -36,7 +37,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/home/eee/Desktop/Earthing/earthing/__init__.py:594: RuntimeWarning: divide by zero encountered in true_divide\n",
"/home/eee/Projects/Earthing/earthing/__init__.py:601: RuntimeWarning: divide by zero encountered in true_divide\n",
" COEF = self.rho/(4*pi*AA)*np.arctan(AA/ALPHA)\n"
]
}
Expand Down
19 changes: 15 additions & 4 deletions earthing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@
#
#

from math import *
from math import sin, cos, tan, atan, log, sqrt, pi

import numpy as np
from numpy.linalg import inv, norm, solve
from numpy.linalg import norm, solve

import matplotlib.pyplot as plt
from matplotlib import path
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm

__all__ = ["Network",
"resistance_plate", "resistance_pipe", "resistance_strip",
"resistance_grid", "resistance_grid_with_rods",
"resistance_parallel",
"e_step_70", "e_touch_70", "e_mesh_step_grid",
"fault_current", "max_current_density", "current_ratio"]

# Limit visibility of modules to __all__
def __dir__():
return __all__


## Resistance functions

Expand Down Expand Up @@ -867,8 +878,8 @@ def plot_surface_potential(self, xlim=(-20, 20), ylim=(-20, 20),
"""

if plot_data is None:
if self.X is None:
raise Exception('Model not solved')
if self.V is None:
raise Exception('Surface potential not solved')
XX = self.XX
YY = self.YY
V = self.V
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = earthing
version = 1.0.0
version = 1.0.1
author = Manu Varkey
author_email = [email protected]
description = A python library for design of earthing networks in electrical substations.
Expand Down

0 comments on commit 42750de

Please sign in to comment.