mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 11:07:57 +00:00
SimParams: less boilerplate
The code look as if it was trying to prevent direct instantiation of the SimParams class. However, instance *creation* in Python is actually handled via `__new__` which was not overridden. In addition, the `get()` accessor was invoking `SimParams.__new__()` directly, which meant that this class was instantiated each time it was needed. Let's cut the boilerplate by getting rid of the extra step and just use the regular constructor. This patch doesn't change anything in actual observable behavior. I still do not like this implicit singleton design pattern, but nuking that will have to wait until some other time. Change-Id: I3ca81bcd0042e91b4f6b7581879922611f18febe
This commit is contained in:
@@ -24,7 +24,7 @@ from gnpy.core.parameters import SimParams
|
||||
from gnpy.core.info import SpectralInformation
|
||||
|
||||
logger = getLogger(__name__)
|
||||
sim_params = SimParams.get()
|
||||
sim_params = SimParams()
|
||||
|
||||
def raised_cosine_comb(f, *carriers):
|
||||
""" Returns an array storing the PSD of a WDM comb of raised cosine shaped
|
||||
|
||||
Reference in New Issue
Block a user