Skip to content

Support pandas 3.x #6

@gituser789

Description

@gituser789

Running the readme-example code

import numpy as np
import magnethub as mh

# instantiate material-specific model
mdl = mh.loss.LossModel(material="3C92", team="paderborn")

# dummy B field data (one trajectory with 1024 samples)
b_wave = np.random.randn(1024)* 200e-3  # in T
freq = 124062  # Hz
temp = 58  # �C

# get power loss in W/m� and estimated H wave in A/m
p, h = mdl(b_wave, freq, temp)

# batch execution for 100 trajectories
b_waves = np.random.randn(100, 1024)* 200e-3  # in T
freqs = np.random.randint(100e3, 750e3, size=100)
temps = np.random.randint(20, 80, size=100)
p, h = mdl(b_waves, freqs, temps)

results in

  File "/mag-net-hub/src_py/magnethub/paderborn.py", line 423, in construct_tensor_seq2seq
    full_b /= b_limit
ValueError: output array is read-only

using the latest pandas version (3.0.1).
Downgrading pandas to 2.3.3 works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions