Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

femmt/examples/inductor_optimization.py broken? #142

Closed
driftregion opened this issue Dec 24, 2024 · 2 comments
Closed

femmt/examples/inductor_optimization.py broken? #142

driftregion opened this issue Dec 24, 2024 · 2 comments

Comments

@driftregion
Copy link

Thanks Paderborn team for releasing femmt!

Describe the bug
running python femmt/examples/inductor_optimization.py results in the following traceback:

To Reproduce

python femmt/examples/inductor_optimization.py
/home/nkirkby/repos/FEM_Magnetics_Toolbox/femmt/optimization/sto.py:505: ExperimentalWarning: NSGAIIISampler is experimental (supported from v3.2.0). The interface can change in the future.
  sampler=optuna.samplers.NSGAIIISampler(),
/home/nkirkby/repos/FEM_Magnetics_Toolbox/femmt/optimization/io.py:331: ExperimentalWarning: NSGAIIISampler is experimental (supported from v3.2.0). The interface can change in the future.
  sampler=optuna.samplers.NSGAIIISampler(),
Inductance:[1.55809288e-06 1.33873565e-06 1.17599351e-06 ... 9.27168903e-03
 8.93333703e-03 8.62101694e-03]
Data is exported to  in a pro-file.
AttributeError: 'float' object has no attribute 'log'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/nkirkby/repos/FEM_Magnetics_Toolbox/femmt/examples/inductor_optimization.py", line 1170, in <module>
    ad = AutomatedDesign(working_directory=working_directory,
  File "/home/nkirkby/repos/FEM_Magnetics_Toolbox/femmt/examples/inductor_optimization.py", line 584, in __init__
    self.data_matrix_4 = self.filter_reluctance_losses(self.data_matrix_3)
  File "/home/nkirkby/repos/FEM_Magnetics_Toolbox/femmt/examples/inductor_optimization.py", line 853, in filter_reluctance_losses
    (1 / (2 * np.pi * data_matrix[:, self.param["core_h_middle"]])) * np.log((data_matrix[:, self.param["r_inner"]] * 2) / \
TypeError: loop of ufunc does not support argument 0 of type float which has no callable log method

Expected behavior
No exception

Desktop (please complete the following information):

python --version
Python 3.10.12

pip freeze --all
alembic==1.14.0
colorlog==6.9.0
contourpy==1.3.1
cycler==0.12.1
deepdiff==8.1.1
exceptiongroup==1.2.2
-e git+ssh://[email protected]/upb-lea/FEM_Magnetics_Toolbox.git@750cef79d2e8121330d8f0bd2e978b972021bacc#egg=femmt
filelock==3.16.1
fonttools==4.55.3
fsspec==2024.12.0
gmsh==4.13.1
greenlet==3.1.1
iniconfig==2.0.0
Jinja2==3.1.5
joblib==1.4.2
kiwisolver==1.4.7
mag-net-hub==0.0.11
Mako==1.3.8
MarkupSafe==3.0.2
materialdatabase==0.3.0
matplotlib==3.8.4
mplcursors==0.6
mpmath==1.3.0
networkx==3.4.2
numpy==1.26.4
nvidia-cublas-cu12==12.4.5.8
nvidia-cuda-cupti-cu12==12.4.127
nvidia-cuda-nvrtc-cu12==12.4.127
nvidia-cuda-runtime-cu12==12.4.127
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.2.1.3
nvidia-curand-cu12==10.3.5.147
nvidia-cusolver-cu12==11.6.1.9
nvidia-cusparse-cu12==12.3.1.170
nvidia-nccl-cu12==2.21.5
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.4.127
onelab==1.0
optuna==4.1.0
orderly-set==5.2.3
packaging==24.2
pandas==2.2.3
pillow==11.0.0
pip==24.3.1
plotly==5.24.1
pluggy==1.5.0
pycodestyle==2.12.1
pyparsing==3.2.0
PyQt5==5.15.11
PyQt5-Qt5==5.15.16
PyQt5_sip==12.16.1
pytest==8.3.4
python-dateutil==2.9.0.post0
pytz==2024.2
PyYAML==6.0.2
scipy==1.12.0
setuptools==75.6.0
six==1.17.0
SQLAlchemy==2.0.36
sympy==1.13.1
tenacity==9.0.0
tomli==2.2.1
torch==2.5.1+cpu
torchinfo==1.8.0
tqdm==4.67.1
triton==3.1.0
typing_extensions==4.12.2
tzdata==2024.2
wheel==0.45.1

 cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"

@sschachten
Copy link
Contributor

Hey Nick,

thank you very much for the bug report. A fix for this problem is currently on the branch "induc_opti_fix".

gituser789 added a commit that referenced this issue Jan 7, 2025
@gituser789
Copy link
Contributor

fixed. Check out main branch to proceed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants