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

**URL:** <https://simpeg.discourse.group/t/simpeg-v0-23-0-magnetic-susceptibility-inversion-error-typeerror-object-must-be-an-instance-of-data/706>\
**Category:** Potential Fields\
**Created:** [April 13, 2025, 6:46am UTC](https://simpeg.discourse.group/t/simpeg-v0-23-0-magnetic-susceptibility-inversion-error-typeerror-object-must-be-an-instance-of-data/706 "2025-04-13T06:46:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kk333](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kk333](https://simpeg.discourse.group/u/kk333)\
**Post date:** [April 13, 2025, 6:46am UTC](https://simpeg.discourse.group/t/simpeg-v0-23-0-magnetic-susceptibility-inversion-error-typeerror-object-must-be-an-instance-of-data/706/1 "2025-04-13T06:46:38Z")

</div>

## 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
