Skip to content

PLA amplification file should not be required when uniform factor is given #1749

@carlfischerjba

Description

@carlfischerjba

The PLA function that loads the amplification ids should by bypassed if a uniform factor is provided since those ids won't be used anyway. Currently amplification ids are always required.


We thought we would be able to use the PLA functionality to apply a basic uniform scaling factor across all events but it seems that this won't work if we don't generate an amplifications.bin. At least that's what the error suggests.

2025-07-16 14:59:11,125 - oasislmf - INFO - {'secondary_factor': 1.0, 'uniform_factor': 1.5, 'file_in': None, 'file_out': None, 'input_path': 'input', 'static_path': 'static', 'run_dir': '.'}
2025-07-16 14:59:11,126 - oasislmf - INFO - starting process
2025-07-16 14:59:11,126 - oasislmf.pytools.pla.structure - ERROR - amplifications.bin not found

I've read https://oasislmf.github.io/sections/post-loss-amplification.html and it's not clear which files are mandatory and which are optional and what the subsequent behaviour is. There's also no mention of the uniform factor.

I had thought that:

  • if neither lossfactors.bin nor amplifications.bin are provided only the uniform factor applies if it is given, else no scaling occurs.
  • if only lossfactors.bin exists then the per event factors defined in that file are applied to all exposures for each event. If a secondary factor is given, that is applied too.
  • if both files are provided, then the factors are applied per event and per amplification id with the secondary factor applying if given.

But given the error message, it would seem that amplifications.bin is mandatory and that only the third case is possible.

https://github.com/OasisLMF/OasisLMF/blob/main/oasislmf/pytools/pla/structure.py#L48 suggests that amplifications.bin is required for plapy to run correctly and there are checks on the structure of it so an empty file won't work.

The loss factors file, however, is optional if a uniform factor is provided: https://github.com/OasisLMF/OasisLMF/blob/main/oasislmf/pytools/pla/structure.py#L142.

So this looks like a bug. The function that loads the amplification ids should by bypassed if a uniform factor is provided.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions