Skip to content

Commit

Permalink
Merge pull request #35 from openEDI/jm/fix_numpy_issue
Browse files Browse the repository at this point in the history
Fix numpy issue in localfeeder
  • Loading branch information
josephmckinsey authored Mar 8, 2023
2 parents 704b5fc + 55c0c22 commit c82c413
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ jobs:
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
- name: build docker container
shell: bash
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.CI_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions LocalFeeder/FeederSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def get_PQs_load(self,static=False):
PQ_load[index] += power/len(ld['phases'])
else:
power = dss.CktElement.Powers()
PQ_load[index] += np.complex(power[2 * ii], power[2 * ii + 1])
PQ_load[index] += complex(power[2 * ii], power[2 * ii + 1])
PQ_names[index] = name
PQ_types[index] = 'Load'

Expand All @@ -302,7 +302,7 @@ def get_PQs_pv(self,static=False):
PQ_PV[index] += power/(len(bus)-1)
else:
power = dss.CktElement.Powers()
PQ_PV[index] += np.complex(power[2 * ii], power[2 * ii + 1])
PQ_PV[index] += complex(power[2 * ii], power[2 * ii + 1])
PQ_names[index] = name
PQ_types[index] = 'PVSystem'
return PQ_PV,PQ_names,PQ_types
Expand All @@ -324,7 +324,7 @@ def get_PQs_gen(self,static=False):
PQ_gen[index] += power/(len(bus)-1)
else:
power = dss.CktElement.Powers()
PQ_gen[index] += np.complex(power[2 * ii], power[2 * ii + 1])
PQ_gen[index] += complex(power[2 * ii], power[2 * ii + 1])
PQ_names[index] = name
PQ_types[index] = 'Generator'
return PQ_gen,PQ_names,PQ_types
Expand All @@ -343,7 +343,7 @@ def get_PQs_cap(self,static=False):
power = complex(0,-1*cap['kVar']) #-1 because it's injected into the grid
PQ_cap[index] += power/cap["numPhases"]
else:
PQ_cap[index] = np.complex(0,cap["power"][2 * ii + 1])
PQ_cap[index] = complex(0,cap["power"][2 * ii + 1])
PQ_names[index] = name
PQ_types[index] = 'Capacitor'

Expand Down
4 changes: 2 additions & 2 deletions LocalFeeder/dss_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_vnom2(dss):

V = np.ones(len(Vnom) // 2, dtype=np.complex_)
for i in range(len(V)):
V[i] = np.complex(Vnom[2 * i], Vnom[2 * i + 1])
V[i] = complex(Vnom[2 * i], Vnom[2 * i + 1])
vnom_dict = {AllNodeNames[ii].upper(): V[ii] for ii in range(len(V))}
return V, vnom_dict

Expand All @@ -100,7 +100,7 @@ def get_vnom(dss):
base = bases[-1] / math.sqrt(3)
V = np.ones(len(Vnom) // 2, dtype=np.complex_)
for i in range(len(V)):
V[i] = np.complex(Vnom[2 * i], Vnom[2 * i + 1]) / (base * 1000)
V[i] = complex(Vnom[2 * i], Vnom[2 * i + 1]) / (base * 1000)

vnom_dict = {AllNodeNames[ii].upper(): V[ii] for ii in range(len(V))}
dss.run_command('BatchEdit Load..* enabled=yes')
Expand Down

0 comments on commit c82c413

Please sign in to comment.