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

Problem with IntervalList nightly cleanup. #1219

Open
lfrank opened this issue Feb 5, 2025 · 1 comment
Open

Problem with IntervalList nightly cleanup. #1219

lfrank opened this issue Feb 5, 2025 · 1 comment

Comments

@lfrank
Copy link
Contributor

lfrank commented Feb 5, 2025

When running the weekly cleanup script:

# ignore datajoint+jupyter async warnings
import warnings

os.environ["SPYGLASS_BASE_DIR"]="/stelmo/nwb"
bd = os.environ["SPYGLASS_BASE_DIR"]
os.environ["SPYGLASS_RECORDING_DIR"] = bd + "/recording"
os.environ["SPYGLASS_SORTING_DIR"]= bd + "/sorting"
os.environ["SPYGLASS_VIDEO_DIR"]= bd + "/video"
os.environ["SPYGLASS_WAVEFORMS_DIR"]= bd + "/waveforms"
os.environ["SPYGLASS_TEMP_DIR"]= bd + "/tmp/spyglass"
os.environ['DJ_SUPPORT_FILEPATH_MANAGEMENT']="True"

import spyglass as sg

# import tables so that we can call them easily
from spyglass.common import AnalysisNwbfile, IntervalList


def main():
    print('Starting AnalysisNwbfile nightly_cleanup function')
    AnalysisNwbfile().nightly_cleanup()
    print('Starting IntervalList nightly_cleanup function')
    IntervalList().nightly_cleanup()


if __name__ == '__main__':
    main()

The output is:

`Please enter DataJoint username: [04:00:28][ERROR] Spyglass: Uncaught exception
Traceback (most recent call last):
  File "/usr/local/bin/weekly_cleanup.py", line 18, in <module>
    from spyglass.common import AnalysisNwbfile, IntervalList
  File "/home/loren/Src/NWB/spyglass/src/spyglass/common/__init__.py", line 3, in <module>
    from spyglass.common.common_behav import (
  File "/home/loren/Src/NWB/spyglass/src/spyglass/common/common_behav.py", line 11, in <module>
    from spyglass.common.common_device import CameraDevice
  File "/home/loren/Src/NWB/spyglass/src/spyglass/common/common_device.py", line 9, in <module>
    schema = dj.schema("common_device")
  File "/home/loren/mambaforge/envs/spyglass/lib/python3.9/site-packages/datajoint/schemas.py", line 78, in __init__
    self.activate(schema_name)
  File "/home/loren/mambaforge/envs/spyglass/lib/python3.9/site-packages/datajoint/schemas.py", line 120, in activate
    self.connection = conn()
  File "/home/loren/mambaforge/envs/spyglass/lib/python3.9/site-packages/datajoint/connection.py", line 124, in conn
    user = input("Please enter DataJoint username: ")
EOFError: EOF when reading a line`
@edeno
Copy link
Collaborator

edeno commented Feb 5, 2025

@lfrank I was able to run AnalysisNwbfile().nightly_cleanup(). IntervalList does not have a nightly cleanup currently. I think it has to do with running an outdated version. The current cleanup script is:

#!/usr/bin/env python

import os

# ignore datajoint+jupyter async warnings
import warnings

warnings.simplefilter("ignore", category=DeprecationWarning)
warnings.simplefilter("ignore", category=ResourceWarning)
# NOTE: "SPIKE_SORTING_STORAGE_DIR" -> "SPYGLASS_SORTING_DIR"
os.environ["SPYGLASS_SORTING_DIR"] = "/stelmo/nwb/spikesorting"


# import tables so that we can call them easily
from spyglass.common import AnalysisNwbfile
from spyglass.decoding.decoding_merge import DecodingOutput
from spyglass.spikesorting import SpikeSorting


def main():
    AnalysisNwbfile().nightly_cleanup()
    SpikeSorting().nightly_cleanup()
    DecodingOutput().cleanup()


if __name__ == "__main__":
    main()

The spikesorting cleanup doesn't actually work here however.

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