materialsinnovation / pymks

Materials Knowledge System in Python
https://pymks.readthedocs.io/
Other
115 stars 76 forks source link

AttributeError: 'Variables' object has no attribute 'create_output_dict' #585

Open btthorn1 opened 1 year ago

btthorn1 commented 1 year ago

Hi, I have been attempting to run the "Effective Stiffness of Fiber Composite" introductory notebook and I continue to encounter an error when running the below cell:

y_stress = solve_fe(x_data, elastic_modulus=(1.3, 2.5), poissons_ratio=(0.42, 0.35), macro_strain=0.001)['stress'][..., 0].persist()

The error is:

~\anaconda3\lib\site-packages\pymks\fmks\data\elastic_fe.py in get_displacement(vec, shape) 751 """ 752 return pipe( --> 753 vec.create_output_dict()["u"].data, 754 lambda x: np.reshape(x, (tuple(x + 1 for x in shape) + x.shape[-1:])), 755 )

AttributeError: 'Variables' object has no attribute 'create_output_dict'

Any help that can be offered would be much appreciated!

wd15 commented 1 year ago

Could you perhaps list out the packages and versions in your environment? pip freeze helps with this if you're using pip or conda list if you're using Conda. It's likely that your version of PyMKS and Sfepy are incompatible. However, if you have the versions I can reconstruct the environment and either provide a work around or let you know how to modify your environment to get things working. Also, could be a bug with a new release of Sfepy that we haven't got to yet, but good to see the versions before I assume anything.

btthorn1 commented 1 year ago

The versions of the packages are PyMKS-0.4.1 and Sfepy-2022.3+git.e3b638fb. I am working in a conda environment currently.

btthorn1 commented 1 year ago

I have a Windows OS as well

wd15 commented 1 year ago

@btthorn1, it looks like we haven't tested PyMKS with version 2022.3 of Sfepy. PyMKS works for sure with version 2022.1. Unfortunately, it looks like the Sfepy API has changed between 2022.1 and 2022.3. Try and revert you Sfepy to 2022.1 and you should be good. I filed this as a bug, so hopefully will be fixed reasonably quickly.