From a66030bdb05760ba713dcd290e7c32c11b11a1d6 Mon Sep 17 00:00:00 2001 From: Capocchi L Date: Sat, 26 Dec 2020 22:28:31 +0100 Subject: [PATCH 1/2] major chnages in Components module --- .gitignore | 4 +- Components.py | 89 +- Container.py | 47 +- Domain/PowerSystem/Continuous/.directory | 3 - Domain/PowerSystem/Continuous/Delay.pyc | Bin 2007 -> 0 bytes Domain/PowerSystem/Continuous/Gain.pyc | Bin 2067 -> 0 bytes Domain/PowerSystem/Continuous/Integrator.pyc | Bin 7798 -> 0 bytes Domain/PowerSystem/Continuous/Integrator2.pyc | Bin 2293 -> 0 bytes Domain/PowerSystem/Continuous/Integrator3.pyc | Bin 7107 -> 0 bytes Domain/PowerSystem/Continuous/NLFunction.pyc | Bin 4142 -> 0 bytes Domain/PowerSystem/Continuous/WSum.pyc | Bin 2774 -> 0 bytes Domain/PowerSystem/Continuous/__init__.py | 9 - Domain/PowerSystem/Continuous/func.pyx | 275 ---- Domain/PowerSystem/Object.pyc | Bin 936 -> 0 bytes Domain/PowerSystem/Sources/ConstGen.pyc | Bin 1793 -> 0 bytes Domain/PowerSystem/Sources/CosGen.pyc | Bin 1612 -> 0 bytes Domain/PowerSystem/Sources/PWMGen.pyc | Bin 2694 -> 0 bytes Domain/PowerSystem/Sources/PulseGen.pyc | Bin 2116 -> 0 bytes Domain/PowerSystem/Sources/RampGen.pyc | Bin 2733 -> 0 bytes Domain/PowerSystem/Sources/SinGen.pyc | Bin 2201 -> 0 bytes Domain/PowerSystem/Sources/StepGen.pyc | Bin 2028 -> 0 bytes Domain/PowerSystem/Sources/TriphaseGen.pyc | Bin 2405 -> 0 bytes Domain/PowerSystem/Sources/__init__.py | 10 - Domain/PowerSystem/Sources/func.c | 1359 ----------------- Domain/PowerSystem/Sources/func.pyx | 12 - Domain/PowerSystem/__init__.py | 0 simu.report | 1 - 27 files changed, 95 insertions(+), 1714 deletions(-) delete mode 100644 Domain/PowerSystem/Continuous/.directory delete mode 100644 Domain/PowerSystem/Continuous/Delay.pyc delete mode 100644 Domain/PowerSystem/Continuous/Gain.pyc delete mode 100644 Domain/PowerSystem/Continuous/Integrator.pyc delete mode 100644 Domain/PowerSystem/Continuous/Integrator2.pyc delete mode 100644 Domain/PowerSystem/Continuous/Integrator3.pyc delete mode 100644 Domain/PowerSystem/Continuous/NLFunction.pyc delete mode 100644 Domain/PowerSystem/Continuous/WSum.pyc delete mode 100644 Domain/PowerSystem/Continuous/__init__.py delete mode 100644 Domain/PowerSystem/Continuous/func.pyx delete mode 100644 Domain/PowerSystem/Object.pyc delete mode 100644 Domain/PowerSystem/Sources/ConstGen.pyc delete mode 100644 Domain/PowerSystem/Sources/CosGen.pyc delete mode 100644 Domain/PowerSystem/Sources/PWMGen.pyc delete mode 100644 Domain/PowerSystem/Sources/PulseGen.pyc delete mode 100644 Domain/PowerSystem/Sources/RampGen.pyc delete mode 100644 Domain/PowerSystem/Sources/SinGen.pyc delete mode 100644 Domain/PowerSystem/Sources/StepGen.pyc delete mode 100644 Domain/PowerSystem/Sources/TriphaseGen.pyc delete mode 100644 Domain/PowerSystem/Sources/__init__.py delete mode 100644 Domain/PowerSystem/Sources/func.c delete mode 100644 Domain/PowerSystem/Sources/func.pyx delete mode 100644 Domain/PowerSystem/__init__.py delete mode 100644 simu.report diff --git a/.gitignore b/.gitignore index 6680cf0e..3284b417 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ local.properties # External tool builders .externalToolBuilders/ +# DEVSimPy-noGui simu report +*.report + # Locally stored "Eclipse launch configurations" *.launch @@ -34,7 +37,6 @@ local.properties # PDT-specific .buildpath - ################# ## Visual Studio ################# diff --git a/Components.py b/Components.py index 52f1461f..03ef5b7c 100644 --- a/Components.py +++ b/Components.py @@ -42,14 +42,12 @@ if builtins.__dict__.get('GUI_FLAG',True): import wx - from pubsub import pub as Publisher - import Editor import ZipManager -from Utilities import replaceAll, GetActiveWindow, path_to_module, install_and_import, printOnStatusBar +from Utilities import replaceAll, GetActiveWindow, printOnStatusBar from NetManager import Net from SimpleFrameEditor import FrameEditor from which import which @@ -80,20 +78,31 @@ def GetClass(elem): clsmembers = getClassMember(elem) if isinstance(clsmembers, dict): - moduleName = path_to_module(elem) - - if 'DomainBehavior' in clsmembers: - DomainClass = clsmembers['DomainBehavior'] - elif 'DomainStructure' in clsmembers: - DomainClass = clsmembers['DomainStructure'] - elif 'Port' in clsmembers: - DomainClass = clsmembers['Port'] - else: - sys.stderr.write(_("Class unknown...")) - return None + + from DomainInterface.DomainBehavior import DomainBehavior + from DomainInterface.DomainStructure import DomainStructure + from Container import Port + + # moduleName = path_to_module(elem) + + # if 'DomainBehavior' in clsmembers: + # DomainClass = clsmembers['DomainBehavior'] + # elif 'DomainStructure' in clsmembers: + # DomainClass = clsmembers['DomainStructure'] + # elif 'Port' in clsmembers: + # DomainClass = clsmembers['Port'] + # else: + # DomainClass = clsmembers[os.path.basename(elem).split('.')[0]] + # sys.stderr.write(_("Class unknown...")) + # print(DomainClass) + # return None ### return only the class that inherite of DomainBehavoir or DomainStructure which are present in the clsmembers dict - return next(filter(lambda c: c != DomainClass and issubclass(c, DomainClass), clsmembers.values()), None) + # return next(filter(lambda c: c != DomainClass and issubclass(c, DomainClass), clsmembers.values()), None) + + DomainClass = (DomainBehavior,DomainStructure,Port) + + return next(filter(lambda c: c not in DomainClass and issubclass(c, DomainClass), clsmembers.values()), None) #for cls in [c for c in clsmembers.values() if c != DomainClass]: # if issubclass(cls, DomainClass): @@ -119,13 +128,12 @@ def GetArgs(cls = None): ### ########################################################### - class DSPComponent: """ """ @staticmethod def Load(filename, label, canvas): - """ Load component from filename + """ Load component from filename. """ from Container import Diagram #assert(filename.endswith('.dsp')) @@ -865,21 +873,46 @@ def GetModule(filename): current_dirname = os.path.dirname(current_dirname) module_name = os.path.basename(filename).split('.py')[0] + name, ext = os.path.splitext(module_name) - # find and load module + # import pkgutil + # search_path = [dir_name] # set to None to see all modules importable from sys.path + # all_modules = [x[1] for x in pkgutil.iter_modules(path=search_path)] + # print(all_modules) + + ### try to import module try: - name, ext = os.path.splitext(module_name) - pkg = '.'.join(module_name.split('.')[0:-1]) - module = importlib.import_module(name, package=pkg) + spec = importlib.util.find_spec(name, dir_name) + if spec is None: + print("Import error 0: " + " module not found") + module = None + else: + module = spec.loader.load_module() + except (ValueError, ImportError) as msg: + sys.stderr.write(_("Module %s not imported from %s: %s!\n"%(module_name,dir_name,str(msg)))) + module = sys.exc_info() + else: + ### if module are finded, we add on sys.modules all of the path to reach the module + ### (for example, PowerSystem.Sources.SinGen, Sources.SinGen and SinGen is the same module SinGen). You can use: + ### from PowerSystem.Sources.SinGen import SinGen + ### from Sources.SinGen import SinGen + ### or SinGen import SinGen + + if module and module not in sys.modules.values(): + ### replace os.sep by . from DOMAIN_PATH into the path of the python module file + if DOMAIN_PATH in dir_name: + L = dir_name.replace(DOMAIN_PATH+os.sep,'').split(os.sep) + names = ['.'.join(L[i:]+[name]) for i in range(len(L))] + else: + ### external lib + ### all python files into the external lib imports other module using relative path! + names = [] - #f, fn, description = imp.find_module(module_name, [dir_name]) - #module = imp.load_module(module_name, f, fn, description) - #f.close() - return module + ### add all combination of path to rach the module + for n in names: + sys.modules[n]=module - except Exception as info: - sys.stderr.write(_("Module %s not imported from %s!\n"%(module_name,dir_name))) - return sys.exc_info() + return module @staticmethod def GetBlock(filename, label): diff --git a/Container.py b/Container.py index fc2420e2..a4c50a6d 100644 --- a/Container.py +++ b/Container.py @@ -391,7 +391,7 @@ def makeDEVSInstance(diagram = None): ### shape list of diagram shape_list = diagram.GetShapeList() - block_list = [c for c in shape_list if isinstance(c, Block)] + block_list = (c for c in shape_list if isinstance(c, Block)) ### for all codeBlock shape, we make the devs instance for m in block_list: @@ -465,18 +465,18 @@ def makeDEVSInstance(diagram = None): dia_0 = diagram.layers[0] shapeL0 = dia_0.GetShapeList() - for m in [s for s in shapeL0 if isinstance(s, iPort)]: + for m in (s for s in shapeL0 if isinstance(s, iPort)): devs_dam.addInPort() diagram.addInPort() - for m in [s for s in shapeL0 if isinstance(s, oPort)]: + for m in (s for s in shapeL0 if isinstance(s, oPort)): devs_uam.addOutPort() diagram.addOutPort() - for m in [s for s in shape_list if isinstance(s, iPort)]: + for m in (s for s in shape_list if isinstance(s, iPort)): devs_dam.addOutPort() - for m in [s for s in shape_list if isinstance(s, oPort)]: + for m in (s for s in shape_list if isinstance(s, oPort)): devs_uam.addInPort() ###================================================================================== @@ -486,13 +486,13 @@ def makeDEVSInstance(diagram = None): ###============================================================================== if hasattr(diagram, 'current_level') and diagram.current_level>0: # for all iPort shape, we make the devs instance - for i,m in enumerate([s for s in shapeL0 if isinstance(s, iPort)]): + for i,m in enumerate((s for s in shapeL0 if isinstance(s, iPort))): p1 = diagram.getDEVSModel().IPorts[i] p2 = devs_dam.IPorts[i] Structurable.ConnectDEVSPorts(diagram, p1, p2) ###============================================================================== else: - for m in [s for s in shape_list if isinstance(s, iPort)]: + for m in (s for s in shape_list if isinstance(s, iPort)): ### add port to coupled model diagram.addInPort() assert(len(diagram.getIPorts()) <= diagram.input) @@ -501,24 +501,36 @@ def makeDEVSInstance(diagram = None): ### Add abstraction level manager if hasattr(diagram, 'current_level') and diagram.current_level>0: # for all oPort shape, we make the devs instance - for i,m in enumerate([s for s in shapeL0 if isinstance(s, oPort)]): + for i,m in enumerate((s for s in shapeL0 if isinstance(s, oPort))): p1 = devs_uam.OPorts[i] p2 = diagram.getDEVSModel().OPorts[i] Structurable.ConnectDEVSPorts(diagram, p1, p2) ###=============================================================================== else: - for m in [s for s in shape_list if isinstance(s, oPort)]: + for m in (s for s in shape_list if isinstance(s, oPort)): ### add port to coupled model diagram.addOutPort() assert(len(diagram.getOPorts()) <= diagram.output) - ### Connection - for m in [s for s in shape_list if isinstance(s, ConnectionShape)]: + ### Connections + for m in (s for s in shape_list if isinstance(s, ConnectionShape)): m1,n1 = m.input m2,n2 = m.output + if isinstance(m1, Block) and isinstance(m2, Block): - p1 = m1.getDEVSModel().OPorts[n1] - p2 = m2.getDEVSModel().IPorts[n2] + try: + p1 = m1.getDEVSModel().OPorts[n1] + except: + msg = _("It seems that the number of internal output ports (%d) of the coupled model %s is not enough!\nPlease check this.")%(len(m1.getDEVSModel().OPorts),m1.label) + sys.stdout.write(msg) + return msg + try: + p2 = m2.getDEVSModel().IPorts[n2] + except: + msg = _("It seems that the number of internal input ports (%d) of the coupled model %s is not enough!\nPlease check this.")%(len(m2.getDEVSModel().IPorts),m2.label) + sys.stdout.write(msg) + return msg + Structurable.ConnectDEVSPorts(diagram, p1, p2) elif isinstance(m1, Block) and isinstance(m2, oPort): @@ -833,8 +845,11 @@ def OnSimulation(self, event): ## make DEVS instance from diagram master = Diagram.makeDEVSInstance(diagram) + if not master or isinstance(master,str): + wx.MessageBox(master, _("Simulation Manager")) + return False ## test of filename model attribute - if all(model.bad_filename_path_flag for model in [m for m in diagram.GetShapeList() if isinstance(m, Block)] if hasattr(model, 'bad_filename_path_flag')): + elif all(model.bad_filename_path_flag for model in [m for m in diagram.GetShapeList() if isinstance(m, Block)] if hasattr(model, 'bad_filename_path_flag')): dial = wx.MessageDialog(win, \ _("You don't make the simulation of the Master model.\nSome models have bad fileName path !"),\ _('Simulation Manager'), \ @@ -2687,7 +2702,7 @@ def getCurrentShape(self, event): """ Return the selected current shape. """ # get coordinate of click in our coordinate system - if isinstance(event,wx.MouseEvent): + if isinstance(event, wx.MouseEvent): point = self.getEventCoordinates(event) self.currentPoint = point @@ -3940,7 +3955,7 @@ def __setstate__(self, state): index = args_from_stored_constructor_py.index(arg) state['args'].update({arg:arg_values[index]}) else: - sys.stderr.write(_("args is None in setstate for ContainerBlock: %s\n"%str(cls))) + #sys.stderr.write(_("args is None in setstate for ContainerBlock: %s\n"%str(cls))) state['args'] = {} else: sys.stderr.write(_("Error in setstate for ContainerBlock: %s\n"%str(cls))) diff --git a/Domain/PowerSystem/Continuous/.directory b/Domain/PowerSystem/Continuous/.directory deleted file mode 100644 index 9b6f8746..00000000 --- a/Domain/PowerSystem/Continuous/.directory +++ /dev/null @@ -1,3 +0,0 @@ -[Dolphin] -Timestamp=2009,4,15,20,3,37 -ViewMode=1 diff --git a/Domain/PowerSystem/Continuous/Delay.pyc b/Domain/PowerSystem/Continuous/Delay.pyc deleted file mode 100644 index e256ca00e2eeee3bff9da91c53953ff2d5d9b246..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2007 zcma)7&2QsG6d!*jwwq+PEkes>F$bVom2At$rK*-DX<8z(Zq;;GA_}sMXVSQh?JzU$ zwoy*dKZ8T}i1?3u<$$;$apS~$c3U+oDlyW$d6_rk_j~XC=A~7w+62Z&zlrb93_^a# zAGbpXWe28M2SLezP=%@!B~k~fg1R=*j>$fuIyJ5cHJJLdHqdFQPwHjgPzbSIKVr_7 zv&$y_Wn+42w|K}#4rLVVaA^a2Oyb0wPZomiZ zW-7-CUlVn>)$>!%V(GM-hX?KUH(h5f@TW--jKiHY4$nUe5-wO{#Ov$M=}0(h!jEMd z1n*ky*Nlq-$7W;0?)gF@l5i9<3SKt8dcLvweDiaAzvFg}nmxxoIPUbFrn~DLbzU}) zzU^<>`@Mq}SY9`ey3JPa#=7^)Z69|JT(JKMxg&KYtL-L{AI2><_RqtF!;bPSK-=xm zK-qyQ4nZ(7P$1(fRR$Ver5e?*6v(YXOIKuI&@we)Em4cwu$Ji(t-xy1Dzio^t6Zj9Y&I6c~Sf9jJvya7CnTnBo%W4cNR_I; zsB_|JbJ+8As)0192LAQgrqfPhA$c0egg0#4vaFq{&;6(e+-tcI+%aiF3$;FVea}h?<%VANi!^Y4K-Os3SI>p zUqOLEWo3A?Q^Dv%_}Rrh{McXwwi}|ZXtxn8oLGnePv+^{00mG2zB5hKr1BF)aEjQG zg5)}n03*YlyExP$4qy>N&T35oRKP5DI8S(H$}nOsIL~y{Aj;&7Wu=2W$_Jvcl2lGp zxfcgt!Y4%u1W{^=t;`-3)wr`S#BoOh?7?{)fE6+g2$4$QY^hlOivdfBu1U}RIAB|F ztf;>-TP{4_vvR}};H$-fE6zNDPe8%93Mo{!$vjUTRk!a7UIzOD7Oi08-Tphg%n9%U zE)~_p4BX(kN9lzeAf<9BSX8PM(W9P!`GI_wJr6pG=e6M6-!RFndi&b)eRxD1X1s13vw}TpXk$VDP zBuC7s2sE0iuG!0`VVY*i)N6Wfb?XNI7>wD|qPuis$@s_*SYz?Oq3CW_2v(US6OmuO Y=Pvi2cL8&|i0B3KB&VIORuohF7rJTAzW@LL diff --git a/Domain/PowerSystem/Continuous/Gain.pyc b/Domain/PowerSystem/Continuous/Gain.pyc deleted file mode 100644 index c5765c0dc9c647b191421da941bae9977720810b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2067 zcmZ`)&2J+$6u0LinVF{9wz~q#0Szkz8wA-RJ_Mz7o2F?AglW}wS0c)4G>n~g+GHkc zPf8nw3$4Un5myfFasM2ybLD`zA#vLi?>SACK(XZKH-5I?&+q-7XMJ|oA<)iW{POe* zlaSx>W84f-)}YJxKrqrIj54i5yINDDsOuelpKK9kF!O>ilWXUC(_pzhQpyj0bG)F- z-DP(xh~jeZ%vl!^Z@Y}kP(-~nN@B28(xe-OZZ~1P<0ftQ0M&xAskC_v^i7XREQj4wfgC-Fjucac$jv>{a*c z+aB2egdmU-&59dI7jUlg!{8)J1kBKPL$r;X4$2yIxdVceCWX*xj5c+4m+8#7pb#XJ zC6{zat|%rk)tL6HHYC12ggM_}I!Kf0;K>-gQ5>bdpILQp zv+mXRzl9~RlxOrf)4TEj_8O9R+M)pKUl4HzhL?@%a_g~#thTO6(Ap45@4Mu*#rTPg zy1lbj@9e|V)+igTo#cBi_ReI=yDb2nMsYvs%homfgbhc&0$o}li0SABJ*N+5m3fRW zq-cYNBSKdJLrg<*Nv>d;5eN(QAmuaRVGtkiJ-kMViXtphut#DJKC{^BHa@RIWsH3)yzG}A6DoIlbw$T>yL*Ffq@GoF)66SN%D7uD{YD;eI68w?uaxr=TvhX)Xkr^O%C zVMBV4{H#4Q_D11{8)CkIP+EB@qo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8$d05}tlRCORC>QA-ttR=F z$nmcr#;|`;W~6Wn*}nW9GWI}Z`AoqZQSpvoT%&v)Zz4KxQ)Z|#g-+~?IB$ycHo;Jk zxl?AW0k=hWJiyaWrKsVKun)zk5#$JeT^89lXo8>Y{R%K#j*0t$nLbC_djwZ;MlmU0 z-2zF*k~||N4y}vH>&K`?z9n&)0gJwiNH^`{8n8yXQq} zm8ha!o?BFX6;*#XAFV_NE~T9s9GIV@;lotXj{Nv8-QSVL*15SE#~Z8ILi@Yxs4TY5 zZ9AUprFOi#2oHZ8oFqh-A)hGfFi25MB)|} z{Ya$u8}02P5&AD&7vsgS4Q)Ps9GnhENM0mTh2Xg&m$9|hv{MVKh~gd?ImzpjA`VsMdGyFWtr zTIk1-1I#2MMXR6r6Lt!Ncng_74CvO%3<{4^P4J8B8Swn!vV&qZgAFX zeo7HxfdoZ_hGHTrPNCN1y-E%5Dognx-ca!PYU~Y2I!;yJaE}QV8K+`p VUnl4F$ru{8%e}iaS<7q6zW@P_tXBX4 diff --git a/Domain/PowerSystem/Continuous/Integrator2.pyc b/Domain/PowerSystem/Continuous/Integrator2.pyc deleted file mode 100644 index c32413f27bce30d0ba34fa63a5670b119733a2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2293 zcmZ`*OK%%D5GHq5ueI#Floov)wn33VX`sYT+k;WGmKDb_>d21e1gN26v0hU0+WSyQ zu4B8(rS>@p`U{eyd&sFkZ@uIv^tQL6ha|oB)>CIFDOTN<21n$~aK7PiX4dnQlQx0z z>yPr=*9Ag;$IWP1u$Y4>uK{6XgD}dBkgnse85)tfVN$Y4n8k8Ogypz(Xl~?KzD25q z^k+(l-Si^v%sNZ4;$7jXM9kEB`}VvDc*kK}`XcD5Ac;Yxu97J5ox2I+q0>o(6AaIw zxRb`d)_WAFEszAtiMW(rmphWjEQq^yJylzYkYH)qO9hXW)2OemG#Yo7><3)P0myXi zhP~`bIGwPd6L1FVH>a;p-?%_PIF~_q2<(@x16o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O?LQhN;hXbbkOZ~ zO^@%U)P{uT4vK$u&@R!_2Ix}f6rUn3j6eiw4_eWd_Q^NsyDGWgXkHcf35i&F%NcpMu4bD(XAY} zW!Bpyz1a)(G{=k~jbuNdt)J^j7nxm(9{RCFqQ~SOM5%FH@z6PdUp_IGxyIuXGlMo* zDWc_7OU|FxBVNU7fhcGV5YZZm`40B&WTG|aX9SJzM-8~0W_R(-740#5V5=-`K!|-V z`(jz7>JVk*edVVp`!uq?tDP=J{_eBXLw+&xnom<{-~-v|4Lm8i#K;@6J0-_DjW-Kw zr6;GP>uR_O*R>9iduKtRz)+^(6e0s6XOmZ-Lp|B{m{vy1DWntZwqR;_W7=;@`?&W_ ziOv{u&TL8nWMYxWM&}JxT_6N3c%tiFAz(p2F$=97rF298(y=bm3L1xE9|V zMrkB=QOeu&9|*b@^gu}tu6OdsaHP8dW3tyi7l9Ma_?UCkqkPuOr%=N&?co)ZPQb)5 z%||?gmCtI%=>W=%SU$BGrzeSx={H(V89q2PsD!IUd)*1sSNLi%twqPUj%&n&P|miy zey8hSa_iqE7}J$P(QpQ`&o63^);%T%kL zFRRrbV6>$7_w8dzS#fU}%aqLEIlEI}#9R+kCp6DRQ~Y9{bRy*p Kc(q4yVfh!9#^e70 diff --git a/Domain/PowerSystem/Continuous/NLFunction.pyc b/Domain/PowerSystem/Continuous/NLFunction.pyc deleted file mode 100644 index 400bfa811a9e14e04a91612621aa9f5b85fb3be6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4142 zcmb7HOLN=E5uO3S7bH=#t+gyy%7u7qv!WAoWjU3^isFcRIjktO%a7eyD~APRh7v3g zpa*~~vFOXnRoO#+LJsyZmH(0-fXXc=pL6pmUk@mWbevQI*32|!8Z+HrzlLj5Q#QkM z@Ynd++$3ZFpqJCf0fOm}@gA;8A=Hq;{^k@ZzZgHpBE$x&zyT?R9 z6yGpWl*WmI1tX6jaWH4s8+^%$%o!0hN8hVKzh4tRCW3MS+b{rvNPx(m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1Jq*x z$Xi-z)JT4m@#BvXxB%W1Oc2YwkIDJ}sI7iY2dq*zo(~mmc}Vl5 z`j}c|T&)%rBf(D<(@Mdyb-0~+<7&;&;%i0ztN3SUoqmdcaXPUN^MBXvoqKY==PyaT ztLTQ_tX62^SLia{%BcDs%LA8A1JWV`(`b%Wsw_7suV zZtG&NmT2eO)cu0GJJeCUDy`)vQRgygN@GBR(`6whp~{wJ+6(3Ba-m!)Th)oGtrct4 zDyoU)>{@<-YlgVyba4NxkN=q`~Uy| diff --git a/Domain/PowerSystem/Continuous/WSum.pyc b/Domain/PowerSystem/Continuous/WSum.pyc deleted file mode 100644 index 5320a6173539ae88f5176c0fc973ca2692a13d07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2774 zcmbVO&2Jk;6rb4-d%bbos4BDt1Pkh+M#8jE(Ncvf&PR*Y;6zQKG;+0CcGk%@-d%TQ zohFujAso4IN2oo5_!Ia`_6Vn*xpCt6#*Rt&5Q1IJo3}G>=e_y8-@M)B`FWS&vVK&L zl*8CB^l*GxP?pftB?!T`nc%|c@x<6RIJ?7yDXg!Uup;Bg+%|>1#pxn`avap)zPhlseBAObhe1CJ!`*mkkjDG(gqc)Pqbuv~XOUDBH&+{1 z-1R`^9qsujTeA^PXD1F7YZBZ5u`jV&!7kydGi7I+W%!?ZOiZ}y!7Yd7D9lmxN z!EPo!l_g1#XVR^_;BXll5Oh%vkyo~YrhbCR*)u+3&pAgna|H9PF=Dh&{HB_}DmXP`JHPQXZR}jm(j8gf)FyDBju4FK2q^>;JYV9XhsUML2AALsAte_!oa{OI9%==OH|_X&C>{hlza6T!jDPLQ-l7 z?_ne}wSxzJy`U4-uFp%tqi~LaD4bUNcB|dG{}7o)hNFVtEzDk&7Ir!S^71U18=tGf z{Nw;)6JoBF^fQ^SNtwxlKdf7YrJ`O}o+neD>R0|8BvFH!dJTe=T(fFkGF@))s^M~% z*NmD`UME!wXOZPRwH_j764DG;;Y;aMHfDT7&5v^@FIQN4{AL3{QX#MeDe z^`4P*mxPpE=F(7+YVqO#yR@9a7LGxV7-+LN;2=#9urSZ%W3I<&&c<0NV$ ziozldm}PrFa6=>b4=1LQ4RZWy+)l#)OVF5v1-q*06Eib7wIfQa-Vqf{y(7em zQ;P`oS>=-y{QWVVqwtzyKS;x97w`Xy#)b>p-HEAF4hcr>kgybd;>v`sbNLUuEBiib zuJ7-W-3^Fgby}A6aJ%kO2~F{*=KF=~`}jc`^hmGz{*yt_o6cYvk%hi5sr1P=Nn9oI z0g3A*h%zTgMKDf292DUhG*yFe49i^b9NW3>FA2&2a7 bzbakt^&5ZZrf?P~q2HP#Uj&h5RE^&OxSm_a diff --git a/Domain/PowerSystem/Continuous/__init__.py b/Domain/PowerSystem/Continuous/__init__.py deleted file mode 100644 index c9697e3b..00000000 --- a/Domain/PowerSystem/Continuous/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -__all__ = [ - "WSum", - "Integrator", - "Integrator2", - "Integrator3", - "Gain", - "NLFunction", - "Delay" -] diff --git a/Domain/PowerSystem/Continuous/func.pyx b/Domain/PowerSystem/Continuous/func.pyx deleted file mode 100644 index 19497b96..00000000 --- a/Domain/PowerSystem/Continuous/func.pyx +++ /dev/null @@ -1,275 +0,0 @@ -## In order to produce .so file (python-pyrex and cython must be installed) -## 1/ cython func.pyx -## 2/ gcc -c -fPIC -I/usr/include/python2.6/ func.c -## 3/ gcc -shared func.o -o func.so - -pidiv3 = 1.047197551 - -cdef extern from "math.h": - double acos(double a) - double cos(double a) - double sqrt(double a) - double fabs(double a) - double abs(double a) - double pow(double a, double b) - -def calc1(double x, double u, double q, double dQ, double INFINITY): - - cdef double sigma = (q-dQ-x)/u - - if(u == 0): - sigma=INFINITY - elif(u > 0): - sigma=(q+dQ-x)/u - - return sigma - -def calc2(double x, double elapsed, double u, double q, double dQ, double mu, double mq, double INFINITY): - cdef double a = mu/2 - cdef double b = u-mq - cdef double c = x-q+dQ - cdef double s = 0.0 - cdef double sigma =INFINITY - - if(a==0): - if(b!=0): - s=-c/b - if(s>0): - # changement d'etat - sigma=s - c=x-q-dQ - s=-c/b - if ((s>0) and (s 0: - s=(-b+sqrt(b*b-4*a*c))/2/a - if (s>0): - # changement d'etat - sigma=s - s=(-b-sqrt(b*b-4*a*c))/2/a - if ((s>0) and (s 0: - s=(-b+sqrt(b*b-4*a*c))/2/a - if ((s>0) and (s0) and (sdQ: - - # changement d'etat - sigma=0 - - return sigma - -def calc3(double x, double elapsed, double u, double q, double dQ, double mu, double mq, double pq, double pu, double INFINITY): - - cdef double a = mu/2-pq - cdef double b = u-mq - cdef double c = x-q-dQ - cdef double v = 0.0 - cdef double w = 0.0 - cdef double A = 0.0 - cdef double B = 0.0 - cdef double i1 = 0.0 - cdef double i2 = 0.0 - cdef double s = 0.0 - cdef double sigma = 0.0 - - if(pu!=0): - - a=3*a/pu - b=3*b/pu - c=3*c/pu - v=b-(a*a/3) - w=c-(b*a/3)+(2*a*a*a/27) - i1=-w/2 - i2=(i1*i1)+(v*v*v/27) - - if(i2>0): - i2=sqrt(i2) - A=i1+i2 - B=i1-i2 - if(A>0): - A=pow(A,1.0/3) - else: - A=-pow(fabs(A),1.0/3) - if(B>0): - B=pow(B,1.0/3) - else: - B=-pow(fabs(B),1.0/3) - - s=A+B-(a/3) - if(s<0): s=INFINITY - - elif(i2==0): - A=i1 - if(A>0): - A=pow(A,1.0/3) - else: - A=-pow(fabs(A),1.0/3) - x1=2*A-(a/3) - x2=-(A+(a/3)) - if(x1<0): - if(x2<0): - s=INFINITY - else: - s=x2 - elif(x2<0) or (x10): - i2=sqrt(i2) - A=i1+i2 - B=i1-i2 - if(A>0): - A=pow(A,1.0/3) - else: - A=-pow(fabs(A),1.0/3) - if(B>0): - A=pow(B,1.0/3) - else: - B=-pow(fabs(B),1.0/3) - - sigma=A+B-(a/3) - - if (s0): - A=pow(A,1.0/3) - else: - A=-pow(fabs(A),1.0/3) - x1=(2*A)-(a/3) - x2=-(A+(a/3)) - if(x1<0): - if(x2<0): - sigma=INFINITY - else: - sigma=x2 - - elif(x2<0) or (x1dQ: - sigma=0 - - return sigma - -def calc4(double q, double dQ, double u): - return [q+dQ*u/fabs(u),0.0,0.0] - -def calc5(double x, double u, double sigma, double mu): - return [x+u*sigma+mu*sigma*sigma/2, u+mu*sigma, 0.0] - -def calc6(double x, double u, double sigma, double mu, double pu): - return [x+u*sigma+(mu*pow(sigma,2))/2.0 + (pu*pow(sigma,3))/3.0, u+mu*sigma+pu*pow(sigma,2), mu/2.0 + pu*sigma] \ No newline at end of file diff --git a/Domain/PowerSystem/Object.pyc b/Domain/PowerSystem/Object.pyc deleted file mode 100644 index 508493671b9b945eca95a34ac7fc32436caf6ca4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 936 zcmYjP&2AGh5cY01KfAQ0LZSyw77{{{P%hk}HmXP}E)XIDJw%HvckQ-Y?XDNw8=5G$ z<|TLpUTGyxJOVdP%s6SAk!I}qvHi_Aez(6L5s<;b&(FUDLjIt0FAdn7f|_Sw-V;HD zw+6lQXGHi@(rqLVe~^djmk^R<<_R+Mg*R)6wrGf8?aczw6s-To+z;a75b z7k;^xG|9LzbQ`0kR`XOyY9YfDo6fmSRYBDyeK+fl_%m8F0q&8uwFqfK*! zT9a|NQ8!&bb%4P-D0nU*7#Nvd*517K>@T82!1!-C?8je?)F%GGD-EQ?Bdy8{bsGyg zhs(=FJW@GNi^<|`?>3&OA5u>j#>zbYba5jS+bb7!hq1IsEn^gWZ-F75me=x^hug9A z?h6tRlOVVvV~(vu*dRkU1k}6qj|hAde|Z*8fMhElDME&{w3ROUbn`sbveeQ5a7RMV z(W7x%ZbslPUmPEArb$oeEAxgTC2l(ybbXB=G<;#w^)w=Pv}_E1@w&|zOp37{I0olS zn#-q;ZMj_6ACJ2&qydR$td1DVm8de@?=kkh;@LI>*9ny{rk}t~dJhfGVaMRB8tHis g>d5SLf<|=UVq-vwxt)4<+(GReZyp`s$-kiFKOTncJOBUy diff --git a/Domain/PowerSystem/Sources/ConstGen.pyc b/Domain/PowerSystem/Sources/ConstGen.pyc deleted file mode 100644 index 7eb75fb33b2833c2f334b07242638cdad138ea24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1793 zcmaJ>!EW0|5ZxsyilSx5HiES7q2-|{!U9#CAm)<^#UTHcYt*f{`9!lqn+`Dm{gwu8!1D>uHqi6Q;4!1z{zwoU6SO)4RkjPk%QZ zFXYyi)rcdR?DMELJ~MYjzy}uN(ig!v3F2sO_oBoa@`wvBiG>9s416n$86TPTG&zaI zeQASl+e-xp*GBz$r_p%UvhMrdIQIRMU^|V1$ya_XB(DvGZ60$Wi}S6AwN10_$pp^} z1_5Vq(4&VBHXlFO{My`aI?cm++j2Tb&8}5)@$D`EWot*;as!4(lTU`h)_LN4iyT+uwa3RB-IGvX>U*mD6L+*F#@it|P4 zLy~HyS*cXE$DZ&)YXX$|m}k6u;*C-c#!RmRRmV+1;doogbTB8W%t|sChMr?<0zqVk z>jqJfxGosLfoF6A&YI+-fmi~EUx`?T<==zGR{w>BwDzy7pua2P@vHc>&-g?J;rOgS zK6`xHFS5~p9{@{?04f-_+0kqOhGA%3Y>Wlrqn@@lBrhJ>Dt0!j>$*tIB-R{ zIbSQF%*Z9V0_jplfgNS4LdXsvU-D19Xvn)5i@^S}si?w|M^Om;KU)r><}&(sl*GQIOW7KzNXar`3}STuQFG9w8> z?(oyZR`LKd8oVE4B~FuZn(RgXm++g!H-%_->2!S&;lg1N-7Th(KR^r*&IVbqEHHRr z^?%4+LTq(5@gko;0`EDscNZ7maLBaQZoBDYWH@le*?=i?0CWb8`WC4w(hLEY!I0bWia;$s1l%syDEpLz)u#d?jBfsw*+gl0jwAdoOB7N+!)Y9vO~DZtt-MULC0p-;C6?&m7qomal9ZFY>l;2wIh8r(6t})6DfrDi@RszU?5FBGIhX z+}~@pzT0IBVUVR^coJ>oN%Z=wFqKLy^`+|^38^OMvnNZ->;uVZ2TEh$s2>Rq0au

P7Ul|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(D^GjR!>b| zyQTAS_th)EefA}tcb5`RxIg=&&fA{dEhcZhqVu&=?>~3r*gHCZYii>Ady2o(`8D~q zC!Q(2t@HiYZeP89{5LvRuD`NAI%*pKITI=7aPrA z928#Vac`-}>_y)xSI!nIXCGQB)|;?6>3zl)(`Ws_E*Gc0s<3Ro*c?5#)uScH4=k@- zId%|zLr3GJw!dLv7>?@%hLJg1@+`CD9|LB?eq96GEeLTmMhJU>i4b<5gQi}lT?BD< z!Far91Es{l2A+5I2GiefTUqH+!Pqn^$+36r&9u5 z50e`nLxn=6+95SXCny9C^e`q&m)oHX#T(N3v|QhR2kIjuJZa<9=)k){fNCGrB%#W! za-7DcVY-iY(>Seld?ZfIaA4wbuH<0(13;Fs*C7B=U&9yh(iuhcGI^O8_)S}Y8WcDQ z7D(rzB$#p$BrtDcP#E!=3>{eqt;3e}o}>b9D3VXd1lE=40TQ-Ya|m=ABM>1M-5}mT z7R9p})UeHQgBb{n?*wo^WWdmmZa=x5s(?|IYF!PKTMU~}G42Ui5!7K|mihw{L_k*P z3LPY;Gw0yzGD3nO+Cu_`p*Gfqu;Wk_5=Y3173m6Gp$pqi5+(y&C4$>5lL&1-ofJFa zh)^!sZWy1K^hDr?O2s>43k&Y<2!S3&{NUgouJCPy}j^oZzeWzQnlU?|uWEi1p z81P4>T0*|nFczw2siA>QnP(Y>z&;gwknBUUA4r%S%@2>}M`u1Q5TH1K`Zmpw3P6HZ$?~yln;b d%4`N`lM^^&!sO99x??!@{5TLrYNf5pe*t82n+*T} diff --git a/Domain/PowerSystem/Sources/PulseGen.pyc b/Domain/PowerSystem/Sources/PulseGen.pyc deleted file mode 100644 index 9ff6551a1e9ce010435913e77a5065c8b52bfd7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2116 zcmaJ?zi-<{6uu)VilTqSaU3Vk5U@pu5NH*r8PXa>99fnfAr9?Yj*AKk2%2}6=}4q< zN2<1}PIiGVEzmtfGPXnK{4E@c79E11W6`Bk-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Y|Rg0>qWU%g_0!6QZsG)b&1iRGwQ~S}ueC7%(9P8s+ExhV6Q@V$J-LlFdaO*k0QdlI0` zKnp$wA;>xfJQ=6!8Xx8QF^KTV5z*c_C-Y3BDx!~ z#%`3fn@!>Ih;9{ASX_^^yi00teKHuxttJOhF@WJ;937^70SadjYw%NB-=0S&p=tKufjS;Q^b(-Ko z($O)D2ik#5Y!hWqf}TR_kg|@$k@YnaFAX-0vjmCz+#wpdN4)1??d2u%CyasC%{v%k!ypP&UPc``7mF*PMFXxEu1VVqU~~H3 zT`&b`C)y~z&aTiAdYxXSBP>rRXrASuy-VA}J>Hz@dqN(ZZwi_^!M+0pz)<9opM(gw zI-BC<=4>3;3N|=r4(Z#yhj7zzt)?GP@A8@6YC({CHSK`zO@+x236?&jhjgAixq1NO zyvU%X0|X5XJTbSjhwLTXo;%^^uo&vpLg3{)Fw0}y_X_xOA*aBOG$=5}S;4NrM(m>m zAXXERRu^8BTwd{I7({y0-xd;!kJ5O?mBn6I&=lwqEk)FQ6Z(wb3Y)F)f#t$ndKZl6EWm*z_g4%UVbzOkK-Pdjj#K4&N67nsaKfa0$zy9>k{)>9rz6T&&P ze@&y0)@J}f5YznRr!5Rk^E!hOfG)LAUAVej`)ypKZdM-#P4 z6sNmUX}I-N5qL`kxO!=(YsR(oXgZ%x=99`-E+pk`a79<+D`Cll9lv2aV)E>_P<)XM l_FWj0%g?ri6DpFPV%0YZbtI(k#f5!@OBkr{5!m@T{U84YVk!Ut diff --git a/Domain/PowerSystem/Sources/SinGen.pyc b/Domain/PowerSystem/Sources/SinGen.pyc deleted file mode 100644 index 3eada68486d6c413baf5e2acc11c58429ebce9a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2201 zcma)7&2Jk;6rb4-d%br0k*2hvP%RuFi$t2X7lhC9)G zH;E2D4pSldbW6DQLoVd-a_9E+jJ+C2h4)3Rh%>n8&h1+>cW=#nYA-Ly|M(VDS8FF8!OqWrT z>0v4}y^}t1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8ll!c1QYJj^$3s5~Cu;MUg^as##7!W9@0meF*}$kL@kzuV2n+1m zZo*j@n~nPZUZe56Wj^rSVdQxyek}?8v#-5~3s&iK%Q#|O#M6$P#zZn6{i%#S!oin~k*_n3KTF&zppHJIW#5JtKZ;3-q7tI$;n zcwI_el@_UfNdUbPHDJ}~94*6Ir1MPg%XEP*f>ntw(PfYtbOkV8ON$e1M^Q zoiM=I9Jppb3cVPixF5LOJ7M>Y(g*M$8y|jJ`)%jX(dDy=R16rLvix5cC3%jmpE*_rTz;YBYmjs1(qmGj^kepLU!q0h@s>Y`5%s+c|9QHd7sQX0!7+=dcko5cx7#!l5g8D8iYO zHQYb%hw&kILjm;=gLW|L`I_0I*FlJ zPoXSN)i?5ce8*&nQpuv6L{~`FVf2cn+TMP|W5KZxGJp9;z}@0>DN5pD5^smz6EG53 zWJDb;PaVC|-f$AFveaRG;1Z;6oq#)X?hZ=fIt2BWTjvnoIz4kkkJZ2|zgHQpPVb%3 zr)q1f-SjXT9Ju1VzF!){gY*{R$nUpgUIK$W@t7k^$@6tndYw6b2aL91{?Cn>Lb(9| z)^Fwj7BQ9ZYMUdU9ePX9MaO|Ea-25U{R5MX7N_A(G&Xozz*DdacoB#-hb(b3Qtl!Lk zEbpw9by-!6yZXFd)U^dI)7h5BzrX`O%io7q2<_8%JyyB-Dal`|m6?a5viI_od2wEm aS1`>uk@b)MG>`6Ed{YEMpvq-voc{pTJkEIl diff --git a/Domain/PowerSystem/Sources/TriphaseGen.pyc b/Domain/PowerSystem/Sources/TriphaseGen.pyc deleted file mode 100644 index 7c4edb500f773cfd3f43f143d44ab2a32b35b14a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2405 zcmah~OK;mo5Z)yziK1lZVeTTf=n|*abNFcgIqJ0@J7!J^36OY z>x5-k_K2`7&yDq_#c~Z&GKarfbvNMllD#ebzT1_2orm-NLu*C&ylpcsJ>jdqABE`= zyWe#sw>v!K!c~#5fdsy12NB~vt2|KMNZgSnI9ziFf``gpEpKkDu0F2XcRaTrd0y9l zI0*gyyIv$DpKptj^^6Ode!#vzzhKo|sqj9(?Q;efJ-B~wVe#I=XV!Y9UfC+w?E1!b zrD2!rYxY*eLptjo=~wa z{V>+ONS0_ky%q(oAFlAOyYEK=c5+X+lx~N6sCPObBxwj3Fq||ggh6ApsWT0qj?Uh4 z27nDuM{fh@EO$hk1~Xayh%__IVg*>UtjMNd&9P~2wl#KvU4&D4c8OhvU5j0T@XW*o z3=2XIVHwWlpCHUB=6eGU;jw$J-Ht*}A%N=S?7Wp16l^?xfMf;=omh zxe8Mr0a4^N9g#Pb5~Ypkm;%+u)PO^~nwW#P%$V+Kav{{I+t2bvohK+RDGXr2MTlbs>JTP&jr_%^0DNy3@PfuzW?;B9VrDZd(pQi*}5_&|Ug z`8ZpK7(S~c{*<&hE0wDTGR{c96S$r5+nc}t_3`Y(V|2G(niA+)Y&wn~`pR))y~o3N zx-2CZh)_j{NPsTf!DH&iv>ogHt{>Cgmmdd>a6OAI-T|27gs6Q7 z5e7~Jw6%JPifNFR^tj-4-LS(Oh>N%hd*TWTsQ3VRbTcKlfQzU6P;Co0ls-cGDQrn> zPDG!k!`Vs0&Ye564lTnR&p;lLGV zqKYVBw?Ydb7KlD!+H#7!UKdj!KW9=3&fEQW01_X8!aB^f005HnW=&MpIY1DU#2}0p zqbU?7@X7t}DZ8BGKxcHE8l3wBCK+Ctgy2M4FBP!;h44>@_GdW`{745qb=bM&PQhz{m*Nyl4hTdaoAc-pSV=g}4w{{TVzCw%|_ diff --git a/Domain/PowerSystem/Sources/__init__.py b/Domain/PowerSystem/Sources/__init__.py deleted file mode 100644 index ea4cc8d3..00000000 --- a/Domain/PowerSystem/Sources/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -__all__ = [ - "StepGen", - "SinGen", - "CosGen", - "RampGen", - "PWMGen", - "PulseGen", - "TriphaseGen", - "ConstGen" -] diff --git a/Domain/PowerSystem/Sources/func.c b/Domain/PowerSystem/Sources/func.c deleted file mode 100644 index f84ac8fd..00000000 --- a/Domain/PowerSystem/Sources/func.c +++ /dev/null @@ -1,1359 +0,0 @@ -/* Generated by Cython 0.11.2 on Wed Jun 23 14:42:12 2010 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyString_CheckExact PyBytes_CheckExact - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#else - #define _USE_MATH_DEFINES -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include -#define __PYX_HAVE_API__devsimpy__Domain__PowerSystem__Sources__func -#include "math.h" -#define __PYX_USE_C99_COMPLEX defined(_Complex_I) - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE -#endif - -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ - - - -static int __pyx_skip_dispatch = 0; - - -/* Type Conversion Predeclarations */ - -#if PY_MAJOR_VERSION < 3 -#define __Pyx_PyBytes_FromString PyString_FromString -#define __Pyx_PyBytes_FromStringAndSize PyString_FromStringAndSize -#define __Pyx_PyBytes_AsString PyString_AsString -#else -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -#define __Pyx_PyBytes_AsString PyBytes_AsString -#endif - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -#if !defined(T_PYSSIZET) -#if PY_VERSION_HEX < 0x02050000 -#define T_PYSSIZET T_INT -#elif !defined(T_LONGLONG) -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1)) -#else -#define T_PYSSIZET \ - ((sizeof(Py_ssize_t) == sizeof(int)) ? T_INT : \ - ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : \ - ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1))) -#endif -#endif - -#if !defined(T_SIZET) -#if !defined(T_ULONGLONG) -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1)) -#else -#define T_SIZET \ - ((sizeof(size_t) == sizeof(unsigned int)) ? T_UINT : \ - ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : \ - ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1))) -#endif -#endif - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; -static const char **__pyx_f; - - -#ifdef CYTHON_REFNANNY -typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*NewContext)(const char*, int, const char*); - void (*FinishContext)(void**); -} __Pyx_RefnannyAPIStruct; -static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; -#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI") -#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r) -#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__) -#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk) -#else -#define __Pyx_INCREF(r) Py_INCREF(r) -#define __Pyx_DECREF(r) Py_DECREF(r) -#define __Pyx_GOTREF(r) -#define __Pyx_GIVEREF(r) -#define __Pyx_XDECREF(r) Py_XDECREF(r) -#define __Pyx_SetupRefcountContext(name) -#define __Pyx_FinishRefcountContext() -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r) -#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r) - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/ - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ -/* Module declarations from devsimpy.Domain.PowerSystem.Sources.func */ - -#define __Pyx_MODULE_NAME "devsimpy.Domain.PowerSystem.Sources.func" -int __pyx_module_is_main_devsimpy__Domain__PowerSystem__Sources__func = 0; - -/* Implementation of devsimpy.Domain.PowerSystem.Sources.func */ -static char __pyx_k___main__[] = "__main__"; -static PyObject *__pyx_kp___main__; -static char __pyx_k_a[] = "a"; -static PyObject *__pyx_kp_a; -static char __pyx_k_phi[] = "phi"; -static PyObject *__pyx_kp_phi; -static char __pyx_k_w[] = "w"; -static PyObject *__pyx_kp_w; -static char __pyx_k_tn[] = "tn"; -static PyObject *__pyx_kp_tn; - -/* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":7 - * float pow(float a, int b) - * - * def calc1(float a, float phi, float w, float tn): # <<<<<<<<<<<<<< - * return a*sin(w*tn+phi) - * def calc2(float a, float phi, float w, float tn): - */ - -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_a; - float __pyx_v_phi; - float __pyx_v_w; - float __pyx_v_tn; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_phi,&__pyx_kp_w,&__pyx_kp_tn,0}; - __Pyx_SetupRefcountContext("calc1"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_phi); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc1", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_w); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc1", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tn); - if (likely(values[3])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc1", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "calc1") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_a = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc1", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc1"); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":8 - * - * def calc1(float a, float phi, float w, float tn): - * return a*sin(w*tn+phi) # <<<<<<<<<<<<<< - * def calc2(float a, float phi, float w, float tn): - * return a*w*cos(w*tn+phi) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_a * sin(((__pyx_v_w * __pyx_v_tn) + __pyx_v_phi)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc1"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":9 - * def calc1(float a, float phi, float w, float tn): - * return a*sin(w*tn+phi) - * def calc2(float a, float phi, float w, float tn): # <<<<<<<<<<<<<< - * return a*w*cos(w*tn+phi) - * def calc3(float a, float phi, float w, float tn): - */ - -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_a; - float __pyx_v_phi; - float __pyx_v_w; - float __pyx_v_tn; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_phi,&__pyx_kp_w,&__pyx_kp_tn,0}; - __Pyx_SetupRefcountContext("calc2"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_phi); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc2", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_w); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc2", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tn); - if (likely(values[3])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc2", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "calc2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_a = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc2", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc2"); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":10 - * return a*sin(w*tn+phi) - * def calc2(float a, float phi, float w, float tn): - * return a*w*cos(w*tn+phi) # <<<<<<<<<<<<<< - * def calc3(float a, float phi, float w, float tn): - * return a*pow(w,2)*sin(w*tn+phi)/2 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_a * __pyx_v_w) * cos(((__pyx_v_w * __pyx_v_tn) + __pyx_v_phi)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc2"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -/* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":11 - * def calc2(float a, float phi, float w, float tn): - * return a*w*cos(w*tn+phi) - * def calc3(float a, float phi, float w, float tn): # <<<<<<<<<<<<<< - * return a*pow(w,2)*sin(w*tn+phi)/2 - */ - -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyObject *__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_a; - float __pyx_v_phi; - float __pyx_v_w; - float __pyx_v_tn; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_phi,&__pyx_kp_w,&__pyx_kp_tn,0}; - __Pyx_SetupRefcountContext("calc3"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[4] = {0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_phi); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc3", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_w); - if (likely(values[2])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc3", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tn); - if (likely(values[3])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("calc3", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "calc3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_a = __pyx_PyFloat_AsDouble(values[0]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(values[2]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(values[3]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_a = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_phi = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_w = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_tn = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calc3", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc3"); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":12 - * return a*w*cos(w*tn+phi) - * def calc3(float a, float phi, float w, float tn): - * return a*pow(w,2)*sin(w*tn+phi)/2 # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((((__pyx_v_a * pow(__pyx_v_w, 2)) * sin(((__pyx_v_w * __pyx_v_tn) + __pyx_v_phi))) / 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func.calc3"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); - return __pyx_r; -} - -static struct PyMethodDef __pyx_methods[] = { - {__Pyx_NAMESTR("calc1"), (PyCFunction)__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc1, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("calc2"), (PyCFunction)__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("calc3"), (PyCFunction)__pyx_pf_8devsimpy_6Domain_11PowerSystem_7Sources_4func_calc3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static void __pyx_init_filenames(void); /*proto*/ - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("func"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1}, - {&__pyx_kp_a, __pyx_k_a, sizeof(__pyx_k_a), 1, 1, 1}, - {&__pyx_kp_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 1, 1, 1}, - {&__pyx_kp_w, __pyx_k_w, sizeof(__pyx_k_w), 1, 1, 1}, - {&__pyx_kp_tn, __pyx_k_tn, sizeof(__pyx_k_tn), 1, 1, 1}, - {0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initfunc(void); /*proto*/ -PyMODINIT_FUNC initfunc(void) -#else -PyMODINIT_FUNC PyInit_func(void); /*proto*/ -PyMODINIT_FUNC PyInit_func(void) -#endif -{ - #ifdef CYTHON_REFNANNY - void* __pyx_refchk = NULL; - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); - if (!__Pyx_Refnanny) { - PyErr_Clear(); - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); - if (!__Pyx_Refnanny) - Py_FatalError("failed to import refnanny module"); - } - __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_func(void)", __LINE__, __FILE__); - #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Library function declarations ---*/ - __pyx_init_filenames(); - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("func"), __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 - Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__pyx_module_is_main_devsimpy__Domain__PowerSystem__Sources__func) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "/home/capocchi/Documents/Recherche/Projets/ENR/Prog/DEVSimPy/Python2_6/svn/devsimpy/Domain/PowerSystem/Sources/func.pyx":11 - * def calc2(float a, float phi, float w, float tn): - * return a*w*cos(w*tn+phi) - * def calc3(float a, float phi, float w, float tn): # <<<<<<<<<<<<<< - * return a*pow(w,2)*sin(w*tn+phi)/2 - */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("devsimpy.Domain.PowerSystem.Sources.func"); - Py_DECREF(__pyx_m); __pyx_m = 0; - __pyx_L0:; - __Pyx_FinishRefcountContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -static const char *__pyx_filenames[] = { - "func.pyx", -}; - -/* Runtime support code */ - -static void __pyx_init_filenames(void) { - __pyx_f = __pyx_filenames; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static INLINE int __Pyx_StrEq(const char *s1, const char *s2) { - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - return *s1 == *s2; -} - -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (unsigned char)-1; - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned char"); - return (unsigned char)-1; - } - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned char"); - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (unsigned short)-1; - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned short"); - return (unsigned short)-1; - } - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned short"); - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (unsigned int)-1; - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned int"); - return (unsigned int)-1; - } - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to unsigned int"); - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (char)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (short)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to short"); - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (int)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (signed char)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to signed char"); - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (signed short)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to signed short"); - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (unlikely(val == -1 && PyErr_Occurred())) - return (signed int)-1; - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to signed int"); - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - return (long)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - return PyLong_AsLong(x); - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - return PyLong_AsLongLong(x); - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - return (signed long)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - return PyLong_AsLong(x); - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_CheckExact(x) || PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_CheckExact(x) || PyLong_Check(x))) { - return PyLong_AsLongLong(x); - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" - -static void __Pyx_AddTraceback(const char *funcname) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - PyObject *py_globals = 0; - PyObject *empty_string = 0; - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif - if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - #if PY_MAJOR_VERSION < 3 - empty_string = PyString_FromStringAndSize("", 0); - #else - empty_string = PyBytes_FromStringAndSize("", 0); - #endif - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - __pyx_lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); - if (!py_code) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = __pyx_lineno; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_string); - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - if (x == Py_True) return 1; - else if ((x == Py_False) | (x == Py_None)) return 0; - else return PyObject_IsTrue(x); -} - -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - diff --git a/Domain/PowerSystem/Sources/func.pyx b/Domain/PowerSystem/Sources/func.pyx deleted file mode 100644 index 80ff3e5e..00000000 --- a/Domain/PowerSystem/Sources/func.pyx +++ /dev/null @@ -1,12 +0,0 @@ - -cdef extern from "math.h": - float sin(float a) - float cos(float a) - float pow(float a, int b) - -def calc1(float a, float phi, float w, float tn): - return a*sin(w*tn+phi) -def calc2(float a, float phi, float w, float tn): - return a*w*cos(w*tn+phi) -def calc3(float a, float phi, float w, float tn): - return a*pow(w,2)*sin(w*tn+phi)/2 diff --git a/Domain/PowerSystem/__init__.py b/Domain/PowerSystem/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/simu.report b/simu.report deleted file mode 100644 index 1e38665e..00000000 --- a/simu.report +++ /dev/null @@ -1 +0,0 @@ -{"date": "Fri Nov 20 06:52:24 2020", "summary": "Simulation in batch mode with PyPDEVS_221...DEVS instance created...Performing DEVS simulation...DEVS simulation completed!", "mode": "no-gui", "time": 10.0, "success": true, "output": [{"label": "MessagesCollector_7_port_0", "filename": "result350.dat"}, {"label": "MessagesCollector_5_port_0", "filename": "result250.dat"}, {"label": "MessagesCollector_3_port_0", "filename": "result60.dat"}, {"label": "MessagesCollector_1_port_0", "filename": "result280.dat"}], "devs_instance": "Master", "duration": 1.9489974975585938} \ No newline at end of file From f3357f267bc6925a0000acd6e4315a03454cd281 Mon Sep 17 00:00:00 2001 From: Capocchi L Date: Sat, 26 Dec 2020 23:21:28 +0100 Subject: [PATCH 2/2] add a simple external lib management to GetModule method --- Components.py | 55 +++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/Components.py b/Components.py index 03ef5b7c..5f3b5747 100644 --- a/Components.py +++ b/Components.py @@ -875,43 +875,46 @@ def GetModule(filename): module_name = os.path.basename(filename).split('.py')[0] name, ext = os.path.splitext(module_name) - # import pkgutil - # search_path = [dir_name] # set to None to see all modules importable from sys.path - # all_modules = [x[1] for x in pkgutil.iter_modules(path=search_path)] - # print(all_modules) - - ### try to import module - try: - spec = importlib.util.find_spec(name, dir_name) - if spec is None: - print("Import error 0: " + " module not found") - module = None - else: + ### try to find the specification of module + spec = importlib.util.find_spec(name, dir_name) + + if spec: + + ### try to import module + try: module = spec.loader.load_module() - except (ValueError, ImportError) as msg: - sys.stderr.write(_("Module %s not imported from %s: %s!\n"%(module_name,dir_name,str(msg)))) - module = sys.exc_info() - else: - ### if module are finded, we add on sys.modules all of the path to reach the module - ### (for example, PowerSystem.Sources.SinGen, Sources.SinGen and SinGen is the same module SinGen). You can use: - ### from PowerSystem.Sources.SinGen import SinGen - ### from Sources.SinGen import SinGen - ### or SinGen import SinGen + except (ValueError, ImportError) as msg: + sys.stderr.write(_("Module %s not imported from %s: %s!\n"%(module_name,dir_name,str(msg)))) + module = sys.exc_info() + else: + ### if module are finded, we add on sys.modules all of the paths allowing to reach the module + ### For example, PowerSystem.Sources.SinGen, Sources.SinGen and SinGen is the same module SinGen. So, You can use: + ### from PowerSystem.Sources.SinGen import SinGen + ### from Sources.SinGen import SinGen + ### or SinGen import SinGen - if module and module not in sys.modules.values(): ### replace os.sep by . from DOMAIN_PATH into the path of the python module file if DOMAIN_PATH in dir_name: L = dir_name.replace(DOMAIN_PATH+os.sep,'').split(os.sep) names = ['.'.join(L[i:]+[name]) for i in range(len(L))] else: ### external lib - ### all python files into the external lib imports other module using relative path! - names = [] - - ### add all combination of path to rach the module + ### we add the directory of the lib (So, for example, you can import module by using form Dir.module import ... or from module import ...) + names = ['.'.join([name,module_name])] + + ### add all combination of path to reach the module for n in names: sys.modules[n]=module + ### TODO: other dependencies are not imported (python files which are not DomainBehavior or DomainStructure but which are imported from this files...) + # import pkgutil + # search_path = [dir_name] # set to None to see all modules importable from sys.path + # all_modules = [x[1] for x in pkgutil.iter_modules(path=search_path)] + # print(all_modules) + else: + print("Import error 0: " + " module not found") + module = None + return module @staticmethod