Skip to content

Commit

Permalink
made tables read only and no usernoread locking
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Sep 20, 2023
1 parent 43a9898 commit f02edca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions radiopadre/casatable.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ def lock_table(self, write=False):
if casacore_tables is None:
raise RuntimeError("no casacore.tables installed")
# check for writability
writable = casacore_tables.tableiswritable(self.fullpath) if self._table is None else self._writeable
writable = False # casacore_tables.tableiswritable(self.fullpath) if self._table is None else self._writeable

if write and not writable:
raise IOError("table is not writable")

# if table object is not open, we won't hold one outside of the context (and auto-locking is good enough)
if self._table is None:
tab = casacore_tables.table(self.fullpath, readonly=not write)
tab = casacore_tables.table(self.fullpath, readonly=not write, lockoptions='usernoread')
yield tab
tab.close()
# if table object is open (i.e. we were created with a query or a sub-table), count locks
Expand Down Expand Up @@ -159,8 +159,8 @@ def _scan_impl(self):
return

if self._table is None:
self._writeable = casacore_tables.tableiswritable(self.fullpath)
self._table = casacore_tables.table(self.fullpath, ack=False, readonly=not self._writeable, lockoptions='user')
self._writeable = False # casacore_tables.tableiswritable(self.fullpath)
self._table = casacore_tables.table(self.fullpath, ack=False, readonly=not self._writeable, lockoptions='usernoread')
else:
self._table.resync()

Expand Down

0 comments on commit f02edca

Please sign in to comment.