Skip to content

The printing of functions introduces unnecessary complexity #334

@DurieuxPol

Description

@DurieuxPol

The newer versions of Pharo changed the way blocks are printed, and this change broke the print tests for FunctionFit. Trying to fix those tests was unnecessary difficult.

The printing of functions display so much information that it feels more appropriate and readable to display them in customised inspector tabs rather than in a single very long string.

For example, when printing this PMGeneralFunctionFit:

	f := [ :x :a :b | (a * x) sin / (b + x squared) ].
	col := (-4 to: 4 by: 0.1) collect: [ :i | i @ (f cull: i cull: 0.1 cull: 0.4) ].
	fit := PMGeneralFunctionFit
		       function: f
		       data: col
		       minimumValues: 0
		       maximumValues: 5.
	fit manager randomGenerator: (Random seed: 42).

the result is:

 'a PMGeneralFunctionFit(PMAnotherGeneticOptimizer( function: [ :x :a :b | (a * x) sin / (b + x squared) ] manager: PMAnotherChromosomeManager( popSize: 50 origin: #(0 0) range: #(5 5) hammersley true MutRate: 0.4 CORate: 0.15 LCRate: 0.29 EIRRate: 0.16) maxIterations: 170 rangeScale: true removeLast: false steadyState: true statistics: false result: nil) with data of size: 81)'

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