Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .github/workflows/pr_nox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR quality (nox)

on:
pull_request:
branches: [ "main" ]

jobs:
nox:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
- os: windows-latest
python-version: "3.13"
- os: macos-latest
python-version: "3.13"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install nox
run: python -m pip install --upgrade pip nox

- name: Run Nox static checks
run: python -m nox -t static_check
7 changes: 5 additions & 2 deletions src/oet/server_client/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import logging
import os
import signal
import sys
import threading
import time
import traceback
Expand Down Expand Up @@ -542,7 +543,8 @@ def worker_initializer() -> None:
"""Initialize a worker process by restoring default signal handling."""
signal.signal(signal.SIGTERM, signal.SIG_DFL)
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGHUP, signal.SIG_DFL)
if sys.platform != "win32":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably remove this completely - might have been over-ambitious to catch HUP.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t expect this to cause any issues anymore, so we might leave it as is for now. It may help catch occasional SSH connection losses.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, leave it for now.

signal.signal(signal.SIGHUP, signal.SIG_DFL)


def main() -> None:
Expand Down Expand Up @@ -616,7 +618,8 @@ def main() -> None:

signal.signal(signal.SIGTERM, lambda s, f: cleanup_and_exit(s, f, executor, parser))
signal.signal(signal.SIGINT, lambda s, f: cleanup_and_exit(s, f, executor, parser))
signal.signal(signal.SIGHUP, lambda s, f: cleanup_and_exit(s, f, executor, parser))
if sys.platform != "win32":
signal.signal(signal.SIGHUP, lambda s, f: cleanup_and_exit(s, f, executor, parser))

# Create workers
workers = args.nthreads
Expand Down
3 changes: 2 additions & 1 deletion tests/mlatom/test_mlatom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest

import torchani

from oet import ROOT_DIR
Expand Down Expand Up @@ -33,7 +34,7 @@ class MLatomTests(unittest.TestCase):
def setUpClass(cls):
# Force download / initialization of ANI-1ccx once
torchani.models.ANI1ccx(periodic_table_index=True)

def test_H2O_engrad(self):
xyz_file, input_file, engrad_out, output_file = get_filenames("H2O")
write_xyz_file(xyz_file, WATER)
Expand Down