PyPO User Manual
 
Loading...
Searching...
No Matches
System I/O Methods

This section contains a list of public PyPO methods which are used for handling input/output with PyPO systems. More...

Functions

 PyPO.System.System.getSystemLogger (self)
 Obtain a reference to the custom logger used by system.
 
 PyPO.System.System.setCustomBeamPath (self, path, append=False)
 Set path to folder containing custom beam patterns.
 
 PyPO.System.System.setSavePath (self, path, append=False)
 Set path to folder were to save output plots.
 
 PyPO.System.System.setSavePathSystems (self, path, append=False)
 Set path to folder were to save systems.
 
 PyPO.System.System.setLoggingVerbosity (self, verbose=True, handler=None)
 Set the verbosity of the logging from within the system.
 
 PyPO.System.System.setOverride (self, override=True)
 Set the override toggle.
 
 PyPO.System.System.saveSystem (self, name)
 Save a system object to disk.
 
 PyPO.System.System.loadSystem (self, name)
 Load a system object from the savePathSystems path.
 
 PyPO.System.System.mergeSystem (self, *systems)
 Merge multiple systems together into current system.
 

Detailed Description

This section contains a list of public PyPO methods which are used for handling input/output with PyPO systems.

Function Documentation

◆ getSystemLogger()

PyPO.System.System.getSystemLogger ( self)

Obtain a reference to the custom logger used by system.

This method can be called to obtain a reference to the logging object that PyPO uses internally. Can be convenient in cases one wants to log their own information in the layout of the PyPO logger.

Returns
clog Reference to system logger.

◆ loadSystem()

PyPO.System.System.loadSystem ( self,
name )

Load a system object from the savePathSystems path.

This loads all reflectors, fields, currents and frames in the system from disk.

The system from which this method is called will be overwritten in its entirety, e.g. all reflectors, fields, currents and frames will be replaced with the internal dictionaries of the system to load. The directory from which the system will be saved will either be the current working directory or the directory specified with setSavePathSystems().

Parameters
nameLoad the system under this name.

◆ mergeSystem()

PyPO.System.System.mergeSystem ( self,
* systems )

Merge multiple systems together into current system.

This method takes a arbitrary amount of system objects and updates the internal dictionaries of the system from which this method is called. This means that the calling system will keep its internal dictionaries. However, if the systems contain a key in the internal dictionaries matching a key in the calling system, this key and item will be overwritten.

Parameters
systemsSystems to be merged into current system

◆ saveSystem()

PyPO.System.System.saveSystem ( self,
name )

Save a system object to disk.

The system from which this method is called will be saved in its entirety, e.g. all reflectors, fields, currents and frames, to disk. The directory to which the system will be saved will either be the current working directory or the directory specified with setSavePathSystems().

Parameters
nameSave the current system under this name.

◆ setCustomBeamPath()

PyPO.System.System.setCustomBeamPath ( self,
path,
append = False )

Set path to folder containing custom beam patterns.

Set the path to the directory where PyPO looks for custom beam patterns. When a custom beam pattern is imported using the readCustomBeam() method, PyPO will look in the specified path for the beam patterns.

Parameters
pathPath to custom beams.
appendWhether path is relative to current working directory or absolute from home.

◆ setLoggingVerbosity()

PyPO.System.System.setLoggingVerbosity ( self,
verbose = True,
handler = None )

Set the verbosity of the logging from within the system.

Sometimes it is preferrable to not generate logging output to the console, for example when PyPO methods are called in for loops. This method allows for on/off switching of the logging unit so that the console is not flooded with logging messages.

Parameters
verboseWhether to enable logging or not.
handlerIf multiple handlers are present, select which handler to adjust.

◆ setOverride()

PyPO.System.System.setOverride ( self,
override = True )

Set the override toggle.

By setting "override" to False, PyPO will start appending number of occurences of a duplicate name instead of overwriting it.

Parameters
overrideWhether to override duplicate reflector names or not.

◆ setSavePath()

PyPO.System.System.setSavePath ( self,
path,
append = False )

Set path to folder were to save output plots.

Set the path to the directory where PyPO saves output plots.

Parameters
pathPath to save directory.
appendWhether path is relative to current working directory or absolute from home.

◆ setSavePathSystems()

PyPO.System.System.setSavePathSystems ( self,
path,
append = False )

Set path to folder were to save systems.

Set the path to the directory where PyPO saves systems.

Parameters
pathPath to save directory.
appendWhether path is relative to current working directory or absolute from home.