CHAP.saxswaxs.server package
Daemon-like application for efficient automated SAXS/WAXS data processing.
Submodules
CHAP.saxswaxs.server.chap module
CHAP.saxswaxs.server.logging_config module
Logging configuration
- class StreamToLogFile(handler)[source]
Bases:
objectWrite stdout/stderr directly to the rotating log file.
- property encoding
- get_task_logger(name, log_level='DEBUG')[source]
Return a logger that writes only to the active task log file.
Unlike
get_logger(), the returned logger is not attached to the shared application log handler. If no task context is active the logger has no handlers and its output is silently discarded.
- task_log_context(log_path)[source]
Context manager that tees log output to a per-task append-only file.
While active, all loggers created via
get_logger()write to log_path in addition to the shared rotating log file, using the same formatter. Raw stdout/stderr writes are also teed to the same file without any additional formatting. The file is always opened in append mode so successive calls accumulate rather than overwrite.
CHAP.saxswaxs.server.saxswaxs_to_chap module
Script to act as a drop-in replacement for the old saxswaxsworkflow CLI tool. Instead of running the old workflow code, a new CHAP pipeline will be constructed & run from the given tool & map configs.
- class VerboseSafeDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]
Bases:
SafeDumperYAML SafeDumper subclass that writes all nodes explicitly without aliases.
- convert_configs(outputdir, tool_config_files, detector_filename='detector_config.yaml', pyfai_filename='pyfai_integration_processor_config.yaml', correction_filename='corrections_config.yaml', fits_filename='fits_config.yaml')[source]
Write the new CHAP.saxswaxs-formatted pyfai and corrections config files based on the old workflow tool files provided. Should be independent from any map configuration or saxswaxsworkflow.workflow.Workflow object – use the dictionaries in the tool_config_files only.
- make_pipeline(outputdir, map_filename='map_config.yaml', detector_filename='detector_config.yaml', pyfai_filename='pyfai_integration_processor_config.yaml', correction_filename='corrections_config.yaml', fits_filename='fits_config.yaml', pipeline_filename='pipeline.yaml')[source]
Compose a pipeline file for a complete saxswaxs workflow based on the config files provided, and asssuming they all already exist. Sort of a lightweight version of wf_to_chap.
- saxswaxs_to_chap(map_config_file, tool_config_files, outputdir, detector_filename='detector_config.yaml', pyfai_filename='pyfai_integration_processor_config.yaml', correction_filename='corrections_config.yaml', fits_filename='fits_config.yaml', pipeline_filename='pipeline.yaml')[source]
Build CHAP pipeline config files from old-style saxswaxs workflow configs.
Converts old-style tool config files to CHAP-format detector, pyFAI integration, and corrections config files via
convert_configs(), then composes the CHAP pipeline config YAML viamake_pipeline().- Parameters:
map_config_file (str) – Path to the map config YAML file.
tool_config_files (list[str]) – List of tool config YAML file paths.
outputdir (str) – Directory in which to write the output CHAP config files.
detector_filename (str, optional) – Output filename for the detector config YAML, defaults to
'detector_config.yaml'.pyfai_filename (str, optional) – Output filename for the pyFAI integration processor config YAML, defaults to
'pyfai_integration_processor_config.yaml'.correction_filename (str, optional) – Output filename for the corrections config YAML, defaults to
'corrections_config.yaml'.fits_filename (str, optional) – Output filename for the fits config YAML, defaults to
'fits_config.yaml'.pipeline_filename (str, optional) – Output filename for the CHAP pipeline config YAML, defaults to
'pipeline.yaml'.