You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a direct consequence of the fact that there is one file which has the same name as a function.
change the import inside the feature extractor to from resspect.bump import bump solved the problem.
Activity
emilleishida commentedon Jul 29, 2023
just transfering the issue here
`from resspect.feature_extractors.bump import BumpFeatureExtractor
path_to_feature_file = '/media/RESSPECT/data/SNPCC/raw/SIMGEN_PUBLIC_DES/DES_SN729076.DAT'
bump_lc = BumpFeatureExtractor()
bump_lc.load_snpcc_lc(path_to_feature_file)
bump_lc.fit_all()
bump_lc.plot_fit()`
returns
`File /media/emille/git/COIN/RESSPECT_work/test_env/2023/resspect2023/lib/python3.8/site-packages/resspect/feature_extractors/bump.py:157, in BumpFeatureExtractor.plot_fit(self, save, show, output_file, figscale, extrapolate, time_flux_pred, unit)
155 if plot_fit:
156 xaxis = np.linspace(min(time), max(time), 500)[:, np.newaxis]
--> 157 fitted_flux = np.array(self.evaluate(xaxis)[self.filters[i]]) * self.features[i * 5 + 4]
158 if unit == 'flux':
159 plt.plot(xaxis, fitted_flux, color='red',
160 lw=1.5, label='Bump fit')
File /media/emille/git/COIN/RESSPECT_work/test_env/2023/resspect2023/lib/python3.8/site-packages/resspect/feature_extractors/bump.py:42, in BumpFeatureExtractor.evaluate(self, time)
39 if 'None' not in self.features[k * 5 : (k + 1) * 5]:
40 for item in time:
41 flux[self.filters[k]].append(
---> 42 bump(item, self.features[0 + k * 5],
43 self.features[1 + k * 5],
44 self.features[2 + k * 5]))
45 else:
46 flux[self.filters[k]].append(None)
TypeError: 'module' object is not callable`
emilleishida commentedon Jul 29, 2023
This is a direct consequence of the fact that there is one file which has the same name as a function.
change the import inside the feature extractor to
from resspect.bump import bump
solved the problem.utthishtastro commentedon Jul 30, 2023
Maybe this PR helps: #119