Skip to content
Snippets Groups Projects
Commit 994d00c0 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Check that `SHPC_dir` exists

Check that `SHPC_dir` exists at initialization of instance of class
SHPC. Before this commit, if `SHPC_dir` did not exist, there was an
error trying to create `n_slices.txt`, which was less clear.
parent a21b1f23
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ from os import path
import numpy as np
import sys
import bisect
import os
class SHPC_class:
def __init__(self, SHPC_dir, def_orient):
......@@ -13,6 +14,9 @@ class SHPC_class:
"""
if not os.access(SHPC_dir, os.R_OK):
sys.exit(f"{SHPC_dir} not readable")
self.dir = SHPC_dir
self.def_orient = def_orient
fname = path.join(SHPC_dir, "n_slices.txt")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment