Mentions légales du service

Skip to content

[bug] fixes a slightly uncommon bug in _guess_filename

E. Madison Bray requested to merge embray/guess-filename-format-bug into master

I noticed this bug could occur sometimes while working on !64 (merged).

If zero-padding is being used in the filenames (e.g. a file name like my_model_scenario_00_replicate_00.npz) if the first file read has a scenario/replicate index that uses all the digits in the filename format (e.g. my_model_scenario_15_replicate_01.npz) then it will not correctly determine the zero-padding for the scenario index (it will guess no zero-padding for the scenario index, and 2 for the replicate index)

This fixes that problem.

Merge request reports