Skip to content

Log absolute path of input data in loader #337

@yousefmoazzam

Description

@yousefmoazzam

If the data path given to the CLI is a relative path, then the loader logging the input data path will be a relative path:

log_once(
f"Loading data: {self._in_file}",
level=logging.DEBUG,
)

This means that the debug.log file will contain a relative path rather than an absolute one, for example:

2024-05-17 17:29:23.555 | INFO     | httomo.utils:log_once:54 - Pipeline has been separated into 2 sections
2024-05-17 17:29:23.556 | INFO     | httomo.utils:log_once:64 - See the full log file at: /dls/tmp/twi18192/17-05-2024_17_29_14_output/user.log
2024-05-17 17:29:23.556 | INFO     | httomo.utils:log_once:56 - Running loader (pattern=projection): standard_tomo...
2024-05-17 17:29:23.573 | DEBUG    | httomo.utils:log_once:48 - The full dataset shape is (220, 128, 160)
2024-05-17 17:29:23.573 | DEBUG    | httomo.utils:log_once:48 - Loading data: ../httomo/tests/test_data/tomo_standard.nxs
2024-05-17 17:29:23.573 | DEBUG    | httomo.utils:log_once:48 - Path to data: entry1/tomo_entry/data/data
2024-05-17 17:29:23.573 | DEBUG    | httomo.utils:log_once:48 - Preview: (0:180, 0:128, 0:160)
2024-05-17 17:29:23.573 | DEBUG    | httomo.utils:log_once:48 - Data shape is (180, 128, 160) of type uint16
2024-05-17 17:29:23.573 | INFO     | httomo.utils:log_once:60 -     Finished loader: standard_tomo (httomo) Took 17.09ms

This is potentially not ideal for debugging purposes, and logging the absolute path to the input data would perhaps be more informative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions