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

error message for wrong absorber site #264

Open
deyulu opened this issue Apr 9, 2024 · 4 comments
Open

error message for wrong absorber site #264

deyulu opened this issue Apr 9, 2024 · 4 comments
Assignees

Comments

@deyulu
Copy link
Collaborator

deyulu commented Apr 9, 2024

Lightshow throws out a confusing error message (see below) about missing POSCAR file, when the absorber element user specified was not part of the system. The error message could be more accurate.


FileNotFoundError Traceback (most recent call last)
/var/folders/ff/xfhfm9fn6svg3lt1y0jm5n9w0000gq/T/ipykernel_17669/995942095.py in
----> 1 database.write("test1", options=[ocean_params], absorbing_atoms=["Cu"])

~/opt/miniconda3/envs/xas_ben/lib/python3.9/site-packages/lightshow/database.py in write(self, root, absorbing_atoms, options, pbar, copy_script, write_unit_cells)
511
512 if write_unit_cells:
--> 513 self._write_unit_cells(root, pbar=pbar)
514
515 self._write_origin_paths(root, pbar=pbar)

~/opt/miniconda3/envs/xas_ben/lib/python3.9/site-packages/lightshow/database.py in _write_unit_cells(self, root, pbar)
334 for key, structure in tqdm(self._structures.items(), disable=not pbar):
335 fname = Path(root) / key / "POSCAR"
--> 336 structure.to(fmt="POSCAR", filename=str(fname))
337
338 def _write_origin_paths(self, root, pbar=False):

~/opt/miniconda3/envs/xas_ben/lib/python3.9/site-packages/pymatgen/core/structure.py in to(self, filename, fmt, **kwargs)
2809
2810 if filename:
-> 2811 writer.write_file(filename)
2812 return str(writer)
2813

~/opt/miniconda3/envs/xas_ben/lib/python3.9/site-packages/pymatgen/io/vasp/inputs.py in write_file(self, filename, **kwargs)
599 the Poscar.get_str method and are passed through directly.
600 """
--> 601 with zopen(filename, mode="wt") as file:
602 file.write(self.get_str(**kwargs))
603

~/opt/miniconda3/envs/xas_ben/lib/python3.9/site-packages/monty/io.py in zopen(filename, *args, **kwargs)
43 if ext in (".XZ", ".LZMA"):
44 return lzma.open(filename, *args, **kwargs)
---> 45 return open(filename, *args, **kwargs) # pylint: disable=R1732
46
47

FileNotFoundError: [Errno 2] No such file or directory: '/Users/deyulu/work/Cu-L_edge/test1/mp-2657/POSCAR'

@matthewcarbone
Copy link
Contributor

@deyulu I'm not sure if I know what's going on here, but it doesn't appear that this is a Lightshow issue. Can you confirm if you're still having this problem? We might have actually resolved this over Zoom, I just don't remember.

@deyulu
Copy link
Collaborator Author

deyulu commented May 16, 2024

@matthewcarbone Now I remember. The issue was that if the absorber element is not in the POSCAR, lightshow gives an error message of missing POSCAR file instead of missing atom type. If nothing changed since, I believe that this issue still remains.

@matthewcarbone
Copy link
Contributor

@deyulu I'm not sure the error you posted is enough for me to help with this. Can you post a reproducible code you used that generated this error? Once I figure out exactly what is going on I can try to clarify the error message. Best if you can reproduce this with data I have or can get from the Materials Project. Thanks!

@deyulu
Copy link
Collaborator Author

deyulu commented May 20, 2024

@matthewcarbone I'll send you a notebook in email.

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