SimPEG v0.23.0 Magnetic Susceptibility Inversion Error - TypeError: Object must be an instance of Data

Hello SimPEG community,
I’m working on a magnetic data processing and susceptibility inversion application. After successfully implementing the data processing part (gridding, RTP, upward continuation), I’m encountering an error during the susceptibility inversion process.
Environment
SimPEG version: 0.23.0
Python 3.10
Windows 11

SimPEG version: 0.23.0
Model grid: 81x87x2 = 14094 cells
Number of data points: 1600
Successfully created UniformBackgroundField magnetic source
Use density model to initialize magnetic susceptibility: Average value = 0.001252 SI
F:\anaconda3\envs\e2\lib\site-packages\simpeg\potential_fields\magnetics\simulation.py:204: FutureWarning: ‘ind_active’ has been deprecated and will be removed in SimPEG v0.24.0, please use ‘active_cells’ instead.
super().init(mesh, engine=engine, numba_parallel=numba_parallel, kwargs)
Error occurred in magnetic susceptibility inversion: Object must be an instance of Data for data
TypeError: Object must be an instance of Data for data

Relevant code section
Create data object
data_obj = SimPEG.data.Data(mag_survey, dobs=dobs, standard_deviation=std)

Create simulation
simulation = magnetics.Simulation3DIntegral(
mesh=mesh,
survey=mag_survey,
model_type=‘scalar’,
chiMap=model_map,
ind_active=active_cells
)

Create data misfit
dmis = SimPEG.data_misfit.L2DataMisfit(data=data_obj, simulation=simulation)

What I’ve tried

  1. I’ve made sure to use UniformBackgroundField instead of the deprecated SourceField

  2. Updated parameter names (e.g., using ind_active instead of actInd)

  3. Created the data object with named parameters (dobs and standard_deviation)

Despite these changes, I’m getting the error during the L2DataMisfit initialization. The error suggests that data_obj is not recognized as an instance of the Data class, even though I’m creating it using SimPEG.data.Data.

Could this be related to API changes in SimPEG 0.23.0? Is there a different way to create a Data object in this version? Or perhaps a compatibility issue with how Survey or Simulation objects are created?

Any help would be greatly appreciated!

Thank you,

kk