Some problems I met when using matminer examples

Hello,
I met some problems when we run some examples downloaded from github.

1.When I run the code “test_examples”, the result is:

Traceback (most recent call last):
File “H:\Python\matminer\matminer_examples-master\tests\test_examples.py”, line 25, in
class NotebookExampleTest(unittest.TestCase):
File “H:\Python\matminer\matminer_examples-master\tests\test_examples.py”, line 50, in NotebookExampleTest
@unittest.skipIf(not all([mp_key, citrine_key]))
TypeError: skipIf() missing 1 required positional argument: ‘reason’

2.When I run the code “test_scripts”, the result is:

EE

ERROR: test_figrecipes (main.ScriptExampleTest)

Traceback (most recent call last):
File “H:\Python\matminer\matminer_examples-master\tests\test_scripts.py”, line 34, in test_figrecipes
output = _script_run(os.path.join(fr_dir, ‘{}.py’.format(test)))
File “H:\Python\matminer\matminer_examples-master\tests\test_scripts.py”, line 53, in _script_run
output = subprocess.check_call(args)
File “H:\Python\lib\subprocess.py”, line 328, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘python’, ‘H:\Python\matminer\matminer_examples-master\tests\…\matminer_examples\figrecipes-py\histogram.py’]’ returned non-zero exit status 1.

======================================================================
ERROR: test_kernel_ridge_SCM_OFM (main.ScriptExampleTest)

Traceback (most recent call last):
File “H:\Python\matminer\matminer_examples-master\tests\test_scripts.py”, line 24, in test_kernel_ridge_SCM_OFM
_script_run(path, extra_args=[’–debug’])
File “H:\Python\matminer\matminer_examples-master\tests\test_scripts.py”, line 53, in _script_run
output = subprocess.check_call(args)
File “H:\Python\lib\subprocess.py”, line 328, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘python’, ‘H:\Python\matminer\matminer_examples-master\tests\…\matminer_examples\machine_learning-py\kernel_ridge_SCM_OFM.py’, ‘–debug’]’ returned non-zero exit status 3221225786.


Ran 2 tests in 51.054s

FAILED (errors=2)

3.When I run the code “kernel_ridge_SCM_OFM”, the result is:

REMOVE UNSTABLE ENTRIES: False
USE FABER DATASET: True
USE TERNARY OXIDE DATASET: False
NUMBER OF JOBS: 24
DEBUG MODE: False
Traceback (most recent call last):
File “H:\Python\matminer\matminer_examples-master\matminer_examples\machine_learning-py\kernel_ridge_SCM_OFM.py”, line 70, in
df = load_dataset(“flla”)
File “H:\Python\lib\site-packages\matminer-master\matminer\datasets\dataset_retrieval.py”, line 62, in load_dataset
dataset_metadata[‘hash’], download_if_missing)
File “H:\Python\lib\site-packages\matminer-master\matminer\datasets\utils.py”, line 92, in _validate_dataset
"Error, hash of downloaded file does not match that "
UserWarning: Error, hash of downloaded file does not match that included in metadata, the data may be corrupt or altered

Those are typical problems I met, and I tried to reinstall matminer and python but still cannot fix those problems.

Hey there,

I wouldn’t recommend running the tests in that repo, they’re not really useful or maintained. The notebooks and scripts though for the most part should work.

For running the kernel_ridge example, that is strange you are getting that.

Are you able to do the following (outside of the script):

from matminer.datasets import load_dataset
df = load_dataset("flla")

If not, make sure you don’t have an old dataset file (from perhaps an older version of matminer) hanging around in your data directory.

Thank you for your advices.
It’s worked after I deleted the old dataset file.

Thanks!