1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

python: fix flake8 errors

This commit is contained in:
Steffen Vogel 2021-02-17 12:33:28 +01:00
parent 07d2ac98a4
commit d06c388e56

View file

@ -3,10 +3,11 @@ from villas.node.node import Node as VILLASnode
# This could be moved to the DPsim Python code later # This could be moved to the DPsim Python code later
# It would be nice if the DPsim Shmem interface could build-up a list of actual
# signal descriptions (names, units, etc..) which attributes are exported.
# This would eliviate the user from manually configuring signal mappings
def get_dpsim_shmem_interface_signals(): def get_dpsim_shmem_interface_signals():
""" It would be nice if the DPsim Shmem interface could build-up a list of actual
signal descriptions (names, units, etc..) which attributes are exported.
This would eliviate the user from manually configuring signal mappings """
signals = [] signals = []
for i in range(0, 30): for i in range(0, 30):
@ -15,9 +16,10 @@ def get_dpsim_shmem_interface_signals():
'type': 'float', 'type': 'float',
'unit': 'volts' 'unit': 'volts'
}) })
return signals return signals
def get_dpsim_shmem_interface_config(): def get_dpsim_shmem_interface_config():
return { return {
'type': 'shmem', 'type': 'shmem',
@ -35,6 +37,7 @@ def get_dpsim_shmem_interface_config():
} }
} }
def get_villas_config(): def get_villas_config():
return { return {
'nodes': { 'nodes': {
@ -65,13 +68,14 @@ def get_villas_config():
] ]
} }
def main(): def main():
node = VILLASnode( node = VILLASnode(
config=get_villas_config() config=get_villas_config()
) )
node.start() # VILLASnode starts running in the background from here.. node.start() # VILLASnode starts running in the background from here..
# Some infos from the running VILLASnode instance queried via its REST API # Some infos from the running VILLASnode instance queried via its REST API
print('VILLASnode running?: ', node.is_running()) print('VILLASnode running?: ', node.is_running())
@ -81,7 +85,8 @@ def main():
print('VILLASnode config: ', node.active_config) print('VILLASnode config: ', node.active_config)
print('VILLASnode version: ', node.get_version()) print('VILLASnode version: ', node.get_version())
# Load a new config into the running VILLASnode instance (old config will be replaced) # Load a new config into the running
# VILLASnode instance (old config will be replaced)
new_config = node.active_config new_config = node.active_config
new_config['paths'].append({ new_config['paths'].append({
'out': 'dpsim1', 'out': 'dpsim1',
@ -95,5 +100,5 @@ def main():
node.stop() node.stop()
if __name___ == 'main': if __name__ == 'main':
main() main()