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

introduce argument workspace_valid #17

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions gappy/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ MakeImmutable(\$GAPPY_ERROUT);


# TODO: Change autoload=True by default
cdef initialize(gap_root=None, gaprc=None, workspace=None, autoload=False):
cdef initialize(gap_root=None, gaprc=None, workspace=None, workspace_valid=False, autoload=False):
"""
Initialize the GAP library, if it hasn't already been initialized.

Expand Down Expand Up @@ -246,7 +246,7 @@ cdef initialize(gap_root=None, gaprc=None, workspace=None, autoload=False):
argv[argc] = '-A'
argc += 1

if workspace is not None:
if workspace_valid:
# Try opening the workspace file, raising the appropriate OSError
# if not found/readable
workspace = os.path.normpath(workspace)
Expand Down Expand Up @@ -605,12 +605,13 @@ cdef class Gap:
gap_root=self._init_kwargs['gap_root'],
gaprc=self._init_kwargs['gaprc'],
workspace=self._init_kwargs['workspace'],
workspace_valid=self._init_kwargs['workspace_valid'],
autoload=self._init_kwargs['autoload']
))
_gap_instance = self
return True

def __init__(self, gap_root=None, gaprc=None, workspace=None,
def __init__(self, gap_root=None, gaprc=None, workspace=None, workspace_valid=False,
autoinit=False, autoload=False):
if _gap_is_initialized:
raise RuntimeError(
Expand All @@ -621,6 +622,7 @@ cdef class Gap:
'gap_root': gap_root,
'gaprc': gaprc,
'workspace': workspace,
'workspace_valid': workspace_valid,
'autoload': autoload
})

Expand Down