Skip to content

Commit

Permalink
Merge pull request #123 from daniel-thom/add-python-3.11
Browse files Browse the repository at this point in the history
Add support for Python 3.11
  • Loading branch information
daniel-thom authored Jun 12, 2023
2 parents cf9dc0d + f7c1c25 commit f098698
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
#os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9]
python-version: ["3.7", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion PyDSS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.2.6"
__version__ = "2.2.7"

from PyDSS.utils.timing_utils import timer_stats_collector
from . import *
5 changes: 0 additions & 5 deletions PyDSS/modes/Dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from PyDSS.modes.solver_base import solver_base
from PyDSS.simulation_input_models import ProjectModel
from PyDSS.utils.timing_utils import timer_stats_collector, track_timing


class Dynamic(solver_base):
Expand Down Expand Up @@ -41,7 +40,6 @@ def reset(self):
self._dssSolution.MaxControlIterations(self._settings.project.max_control_iterations)
return

@track_timing(timer_stats_collector)
def SolveFor(self, mStartTime, mTimeStep):
Hour = int(mStartTime/60)
Min = mStartTime % 60
Expand All @@ -50,7 +48,6 @@ def SolveFor(self, mStartTime, mTimeStep):
self._dssSolution.Solve()
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def IncStep(self):
self._dssSolution.StepSize(self._sStepRes)
self._dssSolution.Solve()
Expand All @@ -61,13 +58,11 @@ def IncStep(self):
self.pyLogger.debug('PyDSS datetime - ' + str(self._Time))
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def reSolve(self):
self._dssSolution.StepSize(0)
self._dssSolution.SolveNoControl()
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def Solve(self):
self._dssSolution.StepSize(0)
self._dssSolution.Solve()
Expand Down
4 changes: 0 additions & 4 deletions PyDSS/modes/QSTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self, dssInstance, settings: ProjectModel):
self._dssSolution.DblHour(start_time_hours)
return

@track_timing(timer_stats_collector)
def SolveFor(self, mStartTime, mTimeStep):
Hour = int(mStartTime/60)
Min = mStartTime%60
Expand All @@ -34,7 +33,6 @@ def SolveFor(self, mStartTime, mTimeStep):
self._dssSolution.Solve()
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def IncStep(self):
self._dssSolution.StepSize(self._sStepRes)
self._dssSolution.Solve()
Expand All @@ -43,13 +41,11 @@ def IncStep(self):
self._Second = (self._dssSolution.DblHour() % 1) * 60 * 60
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def reSolve(self):
self._dssSolution.StepSize(0)
self._dssSolution.SolveNoControl()
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def Solve(self):
self._dssSolution.StepSize(0)
self._dssSolution.Solve()
Expand Down
4 changes: 0 additions & 4 deletions PyDSS/modes/Snapshot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from PyDSS.modes.solver_base import solver_base
from PyDSS.simulation_input_models import ProjectModel
from PyDSS.utils.timing_utils import timer_stats_collector, track_timing


class Snapshot(solver_base):
Expand All @@ -11,20 +10,17 @@ def __init__(self, dssInstance, settings: ProjectModel):
self._dssSolution.MaxControlIterations(settings.max_control_iterations)
return

@track_timing(timer_stats_collector)
def reSolve(self):
self._dssSolution.SolveNoControl()
return self._dssSolution.Converged()

def SimulationSteps(self):
return 1, self._StartTime, self._EndTime

@track_timing(timer_stats_collector)
def Solve(self):
self._dssSolution.Solve()
return self._dssSolution.Converged()

@track_timing(timer_stats_collector)
def IncStep(self):
return self._dssSolution.Solve()

Expand Down
8 changes: 0 additions & 8 deletions PyDSS/pyControllers/Controllers/PvController.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from PyDSS.pyControllers.pyControllerAbstract import ControllerAbstract
import math
import abc
from collections import namedtuple

from PyDSS.pyControllers.pyControllerAbstract import ControllerAbstract
from PyDSS.utils.timing_utils import timer_stats_collector, track_timing


VVarSettings = namedtuple("VVarSettings", ["VmeaMethod", "uMin", "uMax", "uDbMin", "uDbMax", "kVBase"])
Expand Down Expand Up @@ -115,7 +113,6 @@ def ControlledElement(self):
def debugInfo(self):
return [self.__Settings['Control{}'.format(i+1)] for i in range(3)]

@track_timing(timer_stats_collector)
def Update(self, Priority, Time, Update):
self.TimeChange = self.Time != (Priority, Time)
self.Time = (Priority, Time)
Expand All @@ -138,7 +135,6 @@ def Update(self, Priority, Time, Update):
return 0
return self.update[Priority]()

@track_timing(timer_stats_collector)
def VWcontrol(self):
"""Volt / Watt control implementation
"""
Expand Down Expand Up @@ -182,7 +178,6 @@ def VWcontrol(self):
self.oldPcalc = Ppv
return Error

@track_timing(timer_stats_collector)
def CutoffControl(self):
"""Over voltage trip implementation
"""
Expand All @@ -205,7 +200,6 @@ def CutoffControl(self):

return 0

@track_timing(timer_stats_collector)
def CPFcontrol(self):
"""Constant power factor implementation
"""
Expand Down Expand Up @@ -234,7 +228,6 @@ def CPFcontrol(self):
self.__ControlledElm.SetParameter('pf', str(-PFset))
return Error

@track_timing(timer_stats_collector)
def VPFcontrol(self):
"""Variable power factor control implementation
"""
Expand Down Expand Up @@ -271,7 +264,6 @@ def VPFcontrol(self):

return 0

@track_timing(timer_stats_collector)
def VVARcontrol(self):
"""Volt / var control implementation
"""
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ tables
h5py
helics
terminaltables
aiohttp
aiohttp_swagger3==0.4.3
aiohttp~=3.8.2
aiohttp_swagger3>=0.4.3
requests
pymongo
pydantic>=1.8
Expand Down

0 comments on commit f098698

Please sign in to comment.