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

Some of the functions from the "pymks" module do not work. #582

Open
cheongw opened this issue Nov 4, 2022 · 15 comments
Open

Some of the functions from the "pymks" module do not work. #582

cheongw opened this issue Nov 4, 2022 · 15 comments

Comments

@cheongw
Copy link

cheongw commented Nov 4, 2022

Hi,

When the script is run with the functions "PrimitiveBasis( )", "MKSHomogenizationModel( )", and etc., it keeps giving me the error messages as the following:

Warning (from warnings module):
File "C:..., line 4
prim_basis=PrimitiveBasis(n_states=2, domain=[0,1])
DeprecationWarning: Call to deprecated method wrapper. (Use pymks.fmks instead.) -- Deprecated since version 0.4.

Where do I find the user documentation for pymks.fmks? or Which modules should I import to use the functions such as PrimitiveBasis( )", "MKSHomogenizationModel( )", and etc.?

Thank you in advance,
Woo-Jae

@wd15
Copy link
Contributor

wd15 commented Nov 8, 2022

Hi @cheongw: PrimitiveBasis and MKSHomegnizationModel and going to be deprecated in future versions of PyMKS. They are basically no longer supported. The PrimitiveTransformer replaces the functionality of the PrimitiveBasis class. The functionality for the MKSHomegizationModel has now been replaced with a Scikit-learn pipeline with the functionality exposed to the user, see this example.

Of course, older versions of PyMKS are available, but reconstructing the environment would be tough. We're no longer testing the deprecated functions and classes in the CI so those most likely won't work at all now with the latest versions of the Scipy stack.

I hope that helps example what's going on. Please do follow up if you need more help.

@cheongw
Copy link
Author

cheongw commented Nov 8, 2022

Hi Dr. Wheeler,
Thank you for your explanations.
I have been trying the examples in one of your paper, "Materials Knowledge Systems in Python...", which (I think) explains very difficult concepts in an easy-to-understand manner.
I will try those examples in your hyperlink.
Thank you again for your kind responses.
Best regards,
Woo-Jae

@cheongw cheongw closed this as completed Nov 8, 2022
@cheongw cheongw reopened this Nov 8, 2022
@cheongw
Copy link
Author

cheongw commented Nov 8, 2022

Hi Dr. Wheeler,
While following the example in the hyperlink in Conda environment, a strange error seems to appear:

"ImportError: cannot import name 'extension_to_fileype' from 'meshio._helpers'.

The error occurs when the defined "generate_data" function is executed at the line:
"x_train, y_train = generate_data(300, 50)"

Would it require another module to run the examples?

Also, I tried the same example in the Google CoLab, and it did not seem to work since "sfepy" could not be installed in the Google CoLab environment for some reason.

@wd15
Copy link
Contributor

wd15 commented Dec 19, 2022

Hi @cheongw: could you perhaps post a working code snippet (with library imports)? I'm not sure why you're getting this error. Remember that Sfepy isn't necessary to use PyMKS, but only to generate some data for the examples.

@cheongw
Copy link
Author

cheongw commented Dec 19, 2022

Hi Dr. Wheeler,
I just tried your python code examples. The following is the snap-shot of the code:
image

The error starts to appear in the last three lines from the bottom. The results of the execution of the code are as follows:
image
image

I was not sure why the training and the prediction steps did not work.
Thank you in advance.
Best regards,
Woo-Jae

@wd15
Copy link
Contributor

wd15 commented Dec 20, 2022

Could you post the version of PyMKS that you're using and the version of Sfepy?

@wd15
Copy link
Contributor

wd15 commented Dec 20, 2022

Your problem is probably related to this. I would recommend reverting Sfepy to version 2022.1 for now.

@cheongw
Copy link
Author

cheongw commented Dec 20, 2022

Here are some of the version numbers.
(1) Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13)
(2) pymks==0.4.1
(3) sfepy==2022.3

I thought that I can only update the module with pip command.
Would you kindly inform me how to revert it from "sfepy 2022.3" to "sfepy 2022.1"?
Thank you in advance.

@wd15
Copy link
Contributor

wd15 commented Dec 21, 2022

You could try pip install sfepy==2022.1 or if you're using conda conda install sfepy=2022.1 or similar. You may need to use the --force-reinstall with pip, but (I think) conda automatically does a reinstall. With conda though it's probably just best to fire up a new environment (likewise if you're using virtualenv with pip).

Note that PyMKS has a shell.nix so you can use Nix to run your environment if you want to give that a go. It's quite different from Conda and Pip, but I really like it for Python environments. It has a steep learning curve, but keeps things locked down much better.

@cheongw
Copy link
Author

cheongw commented Jan 3, 2023

Based on the below error messages, sfepy==2022.1 does not seemed to be available in the resource location.

image

I may need to wait for the bug fix.
Thank you in advance.

@wd15
Copy link
Contributor

wd15 commented Jan 3, 2023

Based on the below error messages, sfepy==2022.1 does not seemed to be available in the resource location.

It looks like pip doesn't have older versions. You would have to clone the sfepy repository or get the tarball from here and install it from there. Also, this might work

$ pip install https://github.com/sfepy/sfepy/archive/refs/tags/release_2022.1.tar.gz

@cheongw
Copy link
Author

cheongw commented Jan 4, 2023

I was able to install the 2022.1 version of the sfepy module with the help of your command line.
sfepy_version

However, the problem still persists. I obtain a similar error message as below:
Error_msg_2023-01-04

Thank you in advance.

@wd15
Copy link
Contributor

wd15 commented Jan 4, 2023

Double check that you have actually installed the correct version.

$ python -c "import sfepy; print(sfepy.__version__)"

@cheongw
Copy link
Author

cheongw commented Jan 5, 2023

I believe that it is the correct version. Please, refer to the below snapshot:

image

Thank you in advance.

@wd15
Copy link
Contributor

wd15 commented Jan 12, 2023

Sorry for the slow response. Try with version 2020.4 of Sfepy. I have a working environment with 2020.4 of Sfepy and PyMKS version 0.4.1.

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

2 participants