File: __init__.py

package info (click to toggle)
python-gsd 3.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,020 kB
  • sloc: python: 3,141; ansic: 2,057; cpp: 120; makefile: 16
file content (27 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) 2016-2024 The Regents of the University of Michigan
# Part of GSD, released under the BSD 2-Clause License.

"""The GSD main module.

The main package :py:mod:`gsd` is the root package. It holds the submodules
:py:mod:`gsd.fl` and :py:mod:`gsd.hoomd`, but does not import them by default.
You must explicitly import these modules before use::

    import gsd.fl

    import gsd.hoomd
"""

import signal
import sys

from . import version

# Install a SIGTERM handler that gracefully exits, allowing open files to flush
# buffered writes and close. Catch ValueError and pass as there is no way to
# determine if this is the main interpreter running the main thread prior to
# the call.
try:
    signal.signal(signal.SIGTERM, lambda n, f: sys.exit(1))
except ValueError:
    pass