Docs updated for new factory methods

This commit is contained in:
Lukas Klass 2020-09-10 15:42:52 +02:00
parent 5dfb922239
commit cecdc0f335
11 changed files with 45 additions and 31 deletions

View File

@ -68,6 +68,14 @@ esbo\_etc.classes.optical\_component.Mirror module
:undoc-members:
:show-inheritance:
esbo\_etc.classes.optical\_component.OpticalComponentFactory module
-------------------------------------------------------------------
.. automodule:: esbo_etc.classes.optical_component.OpticalComponentFactory
:members:
:undoc-members:
:show-inheritance:
esbo\_etc.classes.optical\_component.StrayLight module
------------------------------------------------------

View File

@ -15,6 +15,22 @@ Subpackages
Submodules
----------
esbo\_etc.classes.AFactory module
---------------------------------
.. automodule:: esbo_etc.classes.AFactory
:members:
:undoc-members:
:show-inheritance:
esbo\_etc.classes.ARadiantFactory module
----------------------------------------
.. automodule:: esbo_etc.classes.ARadiantFactory
:members:
:undoc-members:
:show-inheritance:
esbo\_etc.classes.Config module
-------------------------------
@ -39,14 +55,6 @@ esbo\_etc.classes.IRadiant module
:undoc-members:
:show-inheritance:
esbo\_etc.classes.RadiantFactory module
---------------------------------------
.. automodule:: esbo_etc.classes.RadiantFactory
:members:
:undoc-members:
:show-inheritance:
esbo\_etc.classes.SpectralQty module
------------------------------------

View File

@ -28,6 +28,14 @@ esbo\_etc.classes.target.FileTarget module
:undoc-members:
:show-inheritance:
esbo\_etc.classes.target.TargetFactory module
---------------------------------------------
.. automodule:: esbo_etc.classes.target.TargetFactory
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------

View File

@ -14,7 +14,7 @@ The class must provide a constructor which accepts all attributes of the configu
Additionally, the class must implement the method ``checkConfig()`` in order to check the configuration.
In case of an configuration error, the method must return the corresponding error message.
Optionally, the factory method ``create()`` of the class ``RadiantFactory`` has to be modified, if the constructor of the new component requires more parameters than the configuration tag attributes.
Optionally, the factory method ``create()`` of the class ``TargetFactory`` has to be modified, if the constructor of the new component requires more parameters than the configuration tag attributes.
Adding Optical Components
@ -33,7 +33,7 @@ In case of an configuration error, the method must return the corresponding erro
The method ``propagate()`` is used to model the propagation of incoming radiation through the optical component.
Therefore, this method receives as parameter the incoming radiation as ``SpectralQty``-object and must return the manipulated radiation as ``SpectralQty``-object.
The optional second task consists of modifying the factory method ``create()`` of the class ``RadiantFactory`` in order to properly initialize the new optical component from the configuration.
The optional second task consists of modifying the factory method ``create()`` of the class ``OpticalComponentFactory`` in order to properly initialize the new optical component from the configuration.
This is only necessary if the new optical component needs additional parameters besides the attributes of the corresponding configuration tag of if the new component provides multiple constructors (see class ``Filter``).
Adding Detector Components

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -70,7 +70,7 @@ Hot Optical Component
Class diagram of the hot optical components.
The abstract class ``AHotOpticalComponent`` extends the abstract superclass ``AOpticalComponent`` by implementing the method ``ownNoise()`` assuming grey body radiation in order to model optical components with a thermal background contribution.
This has the consequence, that every subclass of ``AHotOpticalComponent`` must implement the method ``propagate()``, which handles to propagation of the signal and backgroudn radiation through the component.
This has the consequence, that every subclass of ``AHotOpticalComponent`` must implement the method ``propagate()``, which handles to propagation of the signal and background radiation through the component.
Like ``AOpticalComponent``, the class ``AHotOpticalComponent`` provides the abstract method ``checkConfig()`` for checking the configuration file.
Sensor
@ -103,27 +103,17 @@ Factories
---------
In order to instantiate the corresponding objects from the configuration file, the `factory method pattern <https://en.wikipedia.org/wiki/Factory_method_pattern>`_ was used.
The following two factory methods are responsible for transforming the parsed configuration into the cascaded radiation transportation pipeline.
The following factory methods are responsible for transforming the parsed configuration into the cascaded radiation transportation pipeline.
Radiant Factory
^^^^^^^^^^^^^^^
.. figure:: images/Factory.png
:alt: Factory classes
.. figure:: images/RadiantFactory.png
:alt: RadiantFactory class
Class diagram of the factories.
Class diagram of the radiant factory.
The abstract superclass ``AFactory`` provides the abstract method ``create()`` to create any target, optical component and detector object.
Additionally, the method ``collectOptions()`` allows to collect all options from the parsed configuration as dictionary for the constructor call of the corresponding class.
The class ``RadiantFactory`` is responsible for the instantiation of all targets and optical components.
Therefore the method ``create()`` analyzes the parsed configuration and assembles the necessary parameters for the following instantiation of the object.
The method ``fromConfigBatch`` allows to set up a batch of objects starting with a target and continuing with possibly multiple optical components.
Sensor Factory
^^^^^^^^^^^^^^
.. figure:: images/SensorFactory.png
:alt: SensorFactory class
Class diagram of the sensor factory.
The class ``SensorFactory`` allows to instantiate a sensor object from the parsed configuration.
In detail, the method ``create()`` is responsible for assembling all parameters and setting up the object.
The class ``TargetFactory`` is responsible for the instantiation of all subclasses of ``ATarget``.
In contrast, the class ``OpticalComponentFactory`` handles the creation of all subclasses of ``AOpticalComponent``.
It provides the method ``fromConfigBatch`` to set up a batch of optical components.
Finally, the class ``SensorFactory`` is responsible for the instantiation of all subclasses of ``ASensor``.