Skip to content

Commit

Permalink
EventReport.stat file not found error handling (#281)
Browse files Browse the repository at this point in the history
* Updated the e-ph plotting script

* Make use of decorators for band structures

* Modified EventReport.stat to allow for paths that are not found on the local machine.

* Clean up of old stuff.
  • Loading branch information
gbrunin authored Dec 4, 2023
1 parent 92b5b16 commit 9a9f42e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion abipy/flowtk/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def __init__(self, filename: str, events=None):
events: List of Event objects
"""
self.filename = os.path.abspath(filename)
self.stat = os.stat(self.filename)
try:
self.stat = os.stat(self.filename)
except FileNotFoundError:
self.stat = None
self.start_datetime, self.end_datetime = None, None

self._events = []
Expand Down

0 comments on commit 9a9f42e

Please sign in to comment.