-
Notifications
You must be signed in to change notification settings - Fork 732
Closed
Labels
Description
The following four bugs were discovered using pylint.
self.frequenciesandself.monitorshould be initialized toNone.
meep/python/adjoint/objective.py
Lines 26 to 38 in 41548a3
| class EigenmodeCoefficient(ObjectiveQuantitiy): | |
| def __init__(self,sim,volume,mode,forward=True,kpoint_func=None,**kwargs): | |
| ''' | |
| ''' | |
| self.sim = sim | |
| self.volume=volume | |
| self.mode=mode | |
| self.forward = 0 if forward else 1 | |
| self.normal_direction = None | |
| self.kpoint_func = kpoint_func | |
| self.eval = None | |
| self.EigenMode_kwargs = kwargs | |
| return |
same for:
meep/python/adjoint/objective.py
Lines 113 to 118 in 41548a3
| class FourierFields(ObjectiveQuantitiy): | |
| def __init__(self,sim,volume, component): | |
| self.sim = sim | |
| self.volume=volume | |
| self.eval = None | |
| self.component = component |
and:
meep/python/adjoint/objective.py
Lines 170 to 176 in 41548a3
| class Near2FarFields(ObjectiveQuantitiy): | |
| def __init__(self,sim,Near2FarRegions, far_pt): | |
| self.sim = sim | |
| self.Near2FarRegions=Near2FarRegions | |
| self.eval = None | |
| self.far_pt = far_pt | |
| return |
==should be replaced with=:
meep/python/adjoint/objective.py
Line 61 in 41548a3
| k0 == direction_scalar * mp.Vector3(z=1) |
- There are two
returnstatements rather than one:
meep/python/adjoint/filter_source.py
Lines 56 to 57 in 41548a3
| return np.exp(-1j*2*np.pi*f0*t) | |
| return np.where(n.any() < 0.0 or n.any() > self.N,0,np.exp(-1j*2*np.pi*f0*t)) |
etais not defined:
meep/python/adjoint/filters.py
Lines 607 to 608 in 41548a3
| case1 = eta*npa.exp(-beta*(eta-x)/eta) - (eta-x)*npa.exp(-beta) | |
| case2 = 1 - (1-eta)*npa.exp(-beta*(x-eta)/(1-eta)) - (eta-x)*npa.exp(-beta) |