Skip to content

timing.print_table dropped display_fraction/group_by/output_file; 18 examples abort on it #499

Description

@lmoresi

underworld3.timing.print_table is now print_table(filename=None, format='auto'). It previously accepted display_fraction, group_by and output_file, and 18 example files still pass them:

TypeError: print_table() got an unexpected keyword argument 'display_fraction'

Affected (grep for display_fraction / group_by=):

  • fluid_mechanics/advanced: Ex_Navier_Stokes_Benchmarks_NS_DFG_2d_SLCN, Ex_Stokes_Annulus_Benchmark_{Kramer,Thieulot}, Ex_Stokes_Cartesian_SolC, Ex_Stokes_Spherical_Benchmark_{Kramer,Thieulot}
  • fluid_mechanics/intermediate: Ex_Stokes_Flow_Internal_BC, Ex_Stokes_Flow_Obstruction, Ex_Stokes_Flow_Obstruction-3D
  • solid_mechanics: Ex_Sheared_Layer_Elastic, Ex_Compression_AnisotropicFault-3D
  • WIP/developer_tools: six Timing_* files
  • WIP/porous_flow/pramoda_stokes.ipynb

Two possible fixes, and the choice is a judgement call rather than obvious:

  1. Accept the old keywords again and deprecate them. display_fraction is cosmetic and could be accepted-and-ignored with a warning, but group_by and output_file changed behaviour, so silently ignoring those would be worse than raising.
  2. Update all 18 call sites and treat the signature change as intended.

Related to #498 — same file (Ex_Stokes_Cartesian_SolC.py) and the same underlying cause: nothing runs the examples, so API drift lands in them unnoticed. Worth considering a smoke job that executes the examples at trivial resolution.

I have fixed only the SolC call sites, as part of the analytic-suite work; the rest are untouched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions