elisepegg / py_bonemat_abaqus

Assign material properties of bone to a finite element mesh
Other
10 stars 7 forks source link

ValueError: 'jacobian' in __slots__ conflicts with class variable #2

Open AlesAld opened 3 years ago

AlesAld commented 3 years ago

Hello Elise,

first of all, thank you very much for your great job. I would be intersted in extracting the density associated to each element of the mesh for statistical intenisty modelling purposes, and I bumped into your code. However, today I was trying to launch it, but even though I used the example files which were available, I got a number of warinings and in particular the error message I've pasted in the object. Do you have any clues about it? (I am pretty confident using Matlab, but less experienced as far as python is concerned) .

Here I paste the messages I get:

warnings.warn(msg) Traceback (most recent call last): File "C:/Users/DIMEAS/PycharmProjects/pythonProject3/pip.py", line 1, in import pip File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\pip.py", line 6, in from py_bonemat_abaqus.run import run File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\run.py", line 15, in from py_bonemat_abaqus import general, data_import, calc, data_output File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\data_import.py", line 23, in from py_bonemat_abaqus.classes import linear_tet, quad_tet, linear_wedge, linear_hex File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\classes.py", line 398, in class linear_hex: ValueError: 'jacobian' in slots conflicts with class variable

Cheers,

Alessandra

elisepegg commented 3 years ago

Hi Alessandra,

So sorry to hear about this issue with the code. I'm not entirely sure where it is going wrong from the errors but I wonder if it relates to the python version you are using. I wrote the code a while ago and it works with Python 2, but if you try to run it using Python 3 you might well encounter difficulties (I haven't had the time to update the code).

It might also be worth investigating bonemat.org, as that's a better maintained freeware and should do the same thing.

I hope that helps,

Elise


From: AlesAld notifications@github.com Sent: 06 January 2021 17:20 To: elisepegg/py_bonemat_abaqus py_bonemat_abaqus@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [elisepegg/py_bonemat_abaqus] ValueError: 'jacobian' in slots conflicts with class variable (#2)

CAUTION: This email came from outside of the University. To keep your account safe, only click on links and open attachments if you know the person who sent the email, or you expected to receive this communication.

Hello Elise,

first of all, thank you very much for your great job. I would be intersted in extracting the density associated to each element of the mesh for statistical intenisty modelling purposes, and I bumped into your code. However, today I was trying to launch it, but even though I used the example files which were available, I got a number of warinings and in particular the error message I've pasted in the object. Do you have any clues about it? (I am pretty confident using Matlab, but less experienced as far as python is concerned) .

Here I paste the messages I get:

warnings.warn(msg) Traceback (most recent call last): File "C:/Users/DIMEAS/PycharmProjects/pythonProject3/pip.py", line 1, in import pip File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\pip.py", line 6, in from py_bonemat_abaqus.run import run File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\run.py", line 15, in from py_bonemat_abaqus import general, data_import, calc, data_output File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\data_import.py", line 23, in from py_bonemat_abaqus.classes import linear_tet, quad_tet, linear_wedge, linear_hex File "C:\Users\DIMEAS\PycharmProjects\pythonProject3\venv\lib\site-packages\py_bonemat_abaqus\classes.py", line 398, in class linear_hex: ValueError: 'jacobian' in slots conflicts with class variable

Cheers,

Alessandra

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Felisepegg%2Fpy_bonemat_abaqus%2Fissues%2F2&data=04%7C01%7Cecp32%40bath.ac.uk%7C6b70c325c66247933b0f08d8b2675213%7C377e3d224ea1422db0ad8fcc89406b9e%7C0%7C0%7C637455504125343658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zjBZ7NQZVLhiLHFmqSeTmmCl7tmPuGFr%2FhRVizuxAcU%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACKKMIIU2ANQLOS56GFSPPLSYSLURANCNFSM4VX2K4HQ&data=04%7C01%7Cecp32%40bath.ac.uk%7C6b70c325c66247933b0f08d8b2675213%7C377e3d224ea1422db0ad8fcc89406b9e%7C0%7C0%7C637455504125353610%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UYPG6V7xBGoh9SllKUw9FBIGnf5rPSRdp8sElIbJE%2Fg%3D&reserved=0.

DaStMPE commented 1 year ago

Hello Elise and Alessandra,

first of all thank you very much for the very nice and helpful library Elise. I ran into the same issues as Alessandra and after trying to adapt or move the library to python 3, I created a simple workaround for me by calling py_bonemat with a python 2.7 interpreter as subprocess of my python 3 script. Maybe this solution could also work for you Alessandra.

Best regards, Daniel

Trensicourt commented 1 year ago

@DaStMPE Hi! Would you perhaps mind sharing the scripting solution? I'm having issues creating the subprocess.

Trensicourt commented 1 year ago

I did it! It only took me 4 hours, which felt like a life time, to get the code working.

elisepegg commented 1 year ago

Apologies for causing these issues with the out of date Python 2 syntax. I will endeavour to update the script to Python 3 as soon as possible. I notice there is now a python 3 version of pydicom so hopefully this will be fairly straight forward.

Best wishes,

Elise