Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,5 @@ jobs:
pip install ".[all,test]"
- name: run pytests
run: |
pip install pytest pytest-ordering pytest-cov
pip install pytest pytest-ordering
pytest -vvv
- name: Generate coverage report
run: |
pytest --cov=./ --cov-report=xml:unit.coverage.xml
- name: Upload unit test coverage to Codecov
uses: codecov/codecov-action@v1.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./unit.coverage.xml
flags: unit
env_vars: PYTHON
name: codecov-unit
fail_ci_if_error: false
37 changes: 0 additions & 37 deletions .github/workflows/publish-to-pypi.yml

This file was deleted.

253 changes: 134 additions & 119 deletions ditto/readers/opendss/read.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ditto/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = "0.2.4"
__version__ = "0.3.0"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ghp-import~=2.1",
]

numpy_dependency = "numpy~=1.20"
numpy_dependency = "numpy>=2.2.6"

extras_requires = [
"lxml~=4.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_capacitor_connectivity():
diag = round(diag.real, 10) + round(diag.imag, 10) * 1j
rem = ((z0 - z1) / 3) * 0.001 # Units =km
rem = round(rem.real, 11) + round(rem.imag, 10) * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -225,7 +225,7 @@ def test_capacitor_connectivity():
c_diag = round(c_diag.real, 9) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) * 0.001 # Units = km
c_rem = round(c_rem.real, 9) + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_capacitor_connectivity():
diag = round(diag.real, 10) + round(diag.imag, 10) * 1j
rem = ((z0 - z1) / 3) * 0.001 # Units =km
rem = round(rem.real, 10) + round(rem.imag, 10) * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -347,7 +347,7 @@ def test_capacitor_connectivity():
c_diag = round(c_diag.real, 9) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) * 0.001 # Units = km
c_rem = round(c_rem.real, 9) + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down
8 changes: 4 additions & 4 deletions tests/readers/opendss/Lines/test_fuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_fuses():
diag = round(diag.real, 11) + round(diag.imag, 10) * 1j
rem = ((z0 - z1) / 3) * 0.001 # Units = km
rem = round(rem.real, 11) + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -78,7 +78,7 @@ def test_fuses():
c_diag = round(c_diag.real, 10) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) * 0.001 # Units = km
c_rem = round(c_rem.real, 10) + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_fuses():
diag = round(diag.real, 11) + round(diag.imag, 10) * 1j
rem = ((z0 - z1) / 3) * 0.001 # Units = km
rem = round(rem.real, 11) + rem.imag * 1j
imp_matrix = np.zeros((2, 2), dtype=np.complex_)
imp_matrix = np.zeros((2, 2), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -254,7 +254,7 @@ def test_fuses():
c_diag = round(c_diag.real, 10) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) * 0.001 # Units = km
c_rem = round(c_rem.real, 10) + c_rem.imag * 1j
cap_matrix = np.zeros((2, 2), dtype=np.complex_)
cap_matrix = np.zeros((2, 2), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down
12 changes: 6 additions & 6 deletions tests/readers/opendss/Lines/test_line_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_line_connectivity():
diag = round(diag.real, 8) + round(diag.imag, 4) * 1j
rem = (z0 - z1) / 3
rem = round(rem.real, 8) + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -79,7 +79,7 @@ def test_line_connectivity():
c_diag = round(c_diag.real, 4) + c_diag.imag * 1j
c_rem = (c0 - c1) / 3
c_rem = round(c_rem.real, 4) + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_line_connectivity():
diag = round(diag.real, 8) + round(diag.imag, 4) * 1j
rem = (z0 - z1) / 3
rem = round(rem.real, 8) + rem.imag * 1j
imp_matrix = np.zeros((2, 2), dtype=np.complex_)
imp_matrix = np.zeros((2, 2), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -182,7 +182,7 @@ def test_line_connectivity():
c_diag = round(c_diag.real, 4) + c_diag.imag * 1j
c_rem = (c0 - c1) / 3
c_rem = round(c_rem.real, 4) + c_rem.imag * 1j
cap_matrix = np.zeros((2, 2), dtype=np.complex_)
cap_matrix = np.zeros((2, 2), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -276,7 +276,7 @@ def test_line_connectivity():
diag = round(diag.real, 11) + round(diag.imag, 10) * 1j
rem = ((z0 - z1) / 3) / 0.3048 # Units = ft
rem = round(rem.real, 11) + rem.imag * 1j
imp_matrix = np.zeros((2, 2), dtype=np.complex_)
imp_matrix = np.zeros((2, 2), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -287,7 +287,7 @@ def test_line_connectivity():
c_diag = c_diag.real + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 0.3048 # Units = ft
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((2, 2), dtype=np.complex_)
cap_matrix = np.zeros((2, 2), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down
28 changes: 14 additions & 14 deletions tests/readers/opendss/Lines/test_line_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_line_length():
diag = round(diag.real, 8) + round(diag.imag, 4) * 1j
rem = (z0 - z1) / 3
rem = round(rem.real, 8) + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -77,7 +77,7 @@ def test_line_length():
c_diag = round(c_diag.real, 10) + c_diag.imag * 1j
c_rem = (c0 - c1) / 3
c_rem = round(c_rem.real, 10) + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -124,7 +124,7 @@ def test_line_length():
diag = diag.real + diag.imag * 1j
rem = ((z0 - z1) / 3) / 304.8 # Units = kft
rem = rem.real + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -136,7 +136,7 @@ def test_line_length():
c_diag = c_diag.real + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 304.8 # Units = kft
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_line_length():
diag = diag.real + diag.imag * 1j
rem = ((z0 - z1) / 3) / 0.3048 # Units = ft
rem = rem.real + rem.imag * 1j
imp_matrix = np.zeros((2, 2), dtype=np.complex_)
imp_matrix = np.zeros((2, 2), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -196,7 +196,7 @@ def test_line_length():
c_diag = c_diag.real + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 0.3048 # Units = ft
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((2, 2), dtype=np.complex_)
cap_matrix = np.zeros((2, 2), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -288,7 +288,7 @@ def test_line_length():
diag = round(diag.real, 6) + diag.imag * 1j
rem = ((z0 - z1) / 3) / 0.01 # Units = cm
rem = round(rem.real, 6) + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -300,7 +300,7 @@ def test_line_length():
c_diag = c_diag.real + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 0.01 # Units = cm
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -397,7 +397,7 @@ def test_line_length():
diag = diag.real + diag.imag * 1j
rem = ((z0 - z1) / 3) / 1609.34 # Units = mi
rem = rem.real + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -409,7 +409,7 @@ def test_line_length():
c_diag = round(c_diag.real, 18) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 1609.34 # Units = mi
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -461,7 +461,7 @@ def test_line_length():
diag = diag.real + diag.imag * 1j
rem = ((z0 - z1) / 3) / 1609.34 # Units = mi
rem = rem.real + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -473,7 +473,7 @@ def test_line_length():
c_diag = round(c_diag.real, 18) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 1609.34 # Units = mi
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down Expand Up @@ -525,7 +525,7 @@ def test_line_length():
diag = diag.real + diag.imag * 1j
rem = ((z0 - z1) / 3) / 1609.34 # Units = mi
rem = rem.real + rem.imag * 1j
imp_matrix = np.zeros((3, 3), dtype=np.complex_)
imp_matrix = np.zeros((3, 3), dtype=np.complex128)
imp_matrix.fill(rem)
np.fill_diagonal(imp_matrix, diag)
imp_matrix = imp_matrix.tolist()
Expand All @@ -537,7 +537,7 @@ def test_line_length():
c_diag = round(c_diag.real, 18) + c_diag.imag * 1j
c_rem = ((c0 - c1) / 3) / 1609.34 # Units = mi
c_rem = c_rem.real + c_rem.imag * 1j
cap_matrix = np.zeros((3, 3), dtype=np.complex_)
cap_matrix = np.zeros((3, 3), dtype=np.complex128)
cap_matrix.fill(c_rem)
np.fill_diagonal(cap_matrix, c_diag)
cap_matrix = cap_matrix.tolist()
Expand Down
Loading
Loading