Skip to content
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default_language_version:
repos:
# Run fast code improvement/checks before running PR specific helpers.
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand All @@ -19,13 +19,13 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
rev: v6.2.5
hooks:
- id: rstcheck
additional_dependencies: [sphinx]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.14.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
7 changes: 4 additions & 3 deletions postprocessing/Configuration.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# pylint: disable=line-too-long, too-many-statements, too-few-public-methods, too-many-instance-attributes, invalid-name
"""
Post-processing, ActiveMQ, and logging configuration
Post-processing, ActiveMQ, and logging configuration

The original code for this class was take from https://github.com/mantidproject/autoreduce
The original code for this class was take from https://github.com/mantidproject/autoreduce

@copyright: 2014 Oak Ridge National Laboratory
@copyright: 2014 Oak Ridge National Laboratory
"""

import sys
import os
import json
Expand Down
1 change: 1 addition & 0 deletions postprocessing/Consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@copyright: 2014 Oak Ridge National Laboratory
"""

import json
import logging
import time
Expand Down
1 change: 1 addition & 0 deletions postprocessing/PostProcessAdmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@copyright: 2014 Oak Ridge National Laboratory
"""

import logging
import json
import socket
Expand Down
8 changes: 4 additions & 4 deletions postprocessing/processors/base_processor.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
The base processor defines a base class to be used to process jobs.
An input AMQ queue is defined. The post-processing client will
automatically register with that queue upon starting.
The base processor defines a base class to be used to process jobs.
An input AMQ queue is defined. The post-processing client will
automatically register with that queue upon starting.

@copyright: 2014-2015 Oak Ridge National Laboratory
@copyright: 2014-2015 Oak Ridge National Laboratory
"""

import os
Expand Down
6 changes: 3 additions & 3 deletions postprocessing/processors/calvera_processor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
` Processor for Calvera cataloging
` Processor for Calvera cataloging

@copyright: 2023 Oak Ridge National Laboratory
@copyright: 2023 Oak Ridge National Laboratory
"""

import copy
Expand Down Expand Up @@ -74,7 +74,7 @@ def _read_reduced_data(self, filepath):
contents = json.load(f)
if "input_files" not in contents or "output_files" not in contents:
logging.info(
"%s does not appear to be a JSON reduction file so will not " "send to Calvera",
"%s does not appear to be a JSON reduction file so will not send to Calvera",
filepath,
)
return None
Expand Down
5 changes: 3 additions & 2 deletions postprocessing/processors/job_handling.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Handling of job execution.
Handling of job execution.

@copyright: 2014 Oak Ridge National Laboratory
@copyright: 2014 Oak Ridge National Laboratory
"""

import logging
import subprocess
import os
Expand Down
5 changes: 3 additions & 2 deletions postprocessing/processors/oncat_processor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Processor for ONCat cataloging
Processor for ONCat cataloging

@copyright: 2017 Oak Ridge National Laboratory
@copyright: 2017 Oak Ridge National Laboratory
"""

import os
import logging
import json
Expand Down
7 changes: 4 additions & 3 deletions postprocessing/processors/oncat_reduced_processor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Processor for ONCat cataloging
Processor for ONCat cataloging

@copyright: 2017 Oak Ridge National Laboratory
@copyright: 2017 Oak Ridge National Laboratory
"""

import os
import logging
import json
Expand Down Expand Up @@ -57,7 +58,7 @@ def ingest(self, location):
contents = json.load(f)
if "input_files" not in contents or "output_files" not in contents:
logging.info(
"%s does not appear to be a JSON reduction file so will not " "call ONCat",
"%s does not appear to be a JSON reduction file so will not call ONCat",
location,
)
return
Expand Down
5 changes: 3 additions & 2 deletions postprocessing/processors/test_processor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Test Processor
Test Processor

@copyright: 2014 Oak Ridge National Laboratory
@copyright: 2014 Oak Ridge National Laboratory
"""

from .base_processor import BaseProcessor
import json

Expand Down
5 changes: 3 additions & 2 deletions postprocessing/queueProcessor.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
"""
Post-processing agent start script
Post-processing agent start script

@copyright: 2014 Oak Ridge National Laboratory
@copyright: 2014 Oak Ridge National Laboratory
"""

import importlib.metadata
import logging

Expand Down
2 changes: 1 addition & 1 deletion scripts/ar_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def report(self):
f"{self.loadDurationTotal:.1f}",
f"{self.loadEventNexusDuration:.1f}",
f"{reduxTime:.1f}",
f"{self.eventfile.duration-reduxTime:.1f}",
f"{self.eventfile.duration - reduxTime:.1f}",
)


Expand Down
13 changes: 7 additions & 6 deletions tests/reduce_REF_L.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""
Auto-reduction script for the Liquids Reflectometer
For reference:
Type 0: Normal sample data
Type 1: Direct beams for scaling factors
Type 2: Zero-attenuator direct beams
Type 3: Data that we don't need to treat
Auto-reduction script for the Liquids Reflectometer
For reference:
Type 0: Normal sample data
Type 1: Direct beams for scaling factors
Type 2: Zero-attenuator direct beams
Type 3: Data that we don't need to treat
"""

import sys
import os
import warnings
Expand Down
4 changes: 1 addition & 3 deletions tests/test_mantidpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ def verify_subprocess_command(reduce_script, nexus_file, output_dir, expected_ou
# generate command
sub_process_command = generate_subprocess_command(reduce_script, [nexus_file, output_dir], False)

assert sub_process_command == expected_output, "Expected: {}. But: {}" "".format(
expected_output, sub_process_command
)
assert sub_process_command == expected_output, "Expected: {}. But: {}".format(expected_output, sub_process_command)


if __name__ == "__main__":
Expand Down