Skip to content

feat: allow separate operator names for pretty printing #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

MilesCranmer
Copy link
Member

This is part of the solution to MilesCranmer/PySR#843

Pointed out by @arcusfelis

The next stage is to assign different string representations for greater and related operators when in regular printing (used for saving to file) and pretty printing.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13595121827

Details

  • 12 of 12 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 95.578%

Files with Coverage Reduction New Missed Lines %
src/Strings.jl 1 93.41%
Totals Coverage Status
Change from base Build 13188501181: -0.03%
Covered Lines: 2572
Relevant Lines: 2691

💛 - Coveralls

Copy link
Contributor

Benchmark Results

master e3cd937... master / e3cd937...
eval/ComplexF32/evaluation 7.25 ± 0.6 ms 7.29 ± 0.63 ms 0.995
eval/ComplexF64/evaluation 10.8 ± 0.81 ms 10.9 ± 1.2 ms 0.992
eval/Float32/derivative 12 ± 1.1 ms 13.5 ± 2.3 ms 0.887
eval/Float32/derivative_turbo 12 ± 1.3 ms 13.1 ± 2.1 ms 0.918
eval/Float32/evaluation 2.74 ± 0.25 ms 2.79 ± 0.27 ms 0.982
eval/Float32/evaluation_bumper 0.608 ± 0.016 ms 0.59 ± 0.016 ms 1.03
eval/Float32/evaluation_turbo 0.556 ± 0.028 ms 0.609 ± 0.03 ms 0.914
eval/Float32/evaluation_turbo_bumper 0.609 ± 0.015 ms 0.587 ± 0.016 ms 1.04
eval/Float64/derivative 15 ± 0.83 ms 15.3 ± 0.73 ms 0.982
eval/Float64/derivative_turbo 15 ± 0.73 ms 15.8 ± 0.88 ms 0.947
eval/Float64/evaluation 3.17 ± 0.32 ms 3.21 ± 0.32 ms 0.989
eval/Float64/evaluation_bumper 1.26 ± 0.043 ms 1.2 ± 0.045 ms 1.05
eval/Float64/evaluation_turbo 1.05 ± 0.063 ms 1.11 ± 0.059 ms 0.944
eval/Float64/evaluation_turbo_bumper 1.25 ± 0.043 ms 1.19 ± 0.045 ms 1.05
utils/combine_operators/break_sharing 0.0384 ± 0.0005 ms 0.0386 ± 0.00078 ms 0.993
utils/convert/break_sharing 26.6 ± 3.2 μs 27.6 ± 3.1 μs 0.963
utils/convert/preserve_sharing 0.0984 ± 0.0062 ms 0.1 ± 0.0045 ms 0.983
utils/copy/break_sharing 26.9 ± 3.3 μs 28.7 ± 2.9 μs 0.938
utils/copy/preserve_sharing 0.0986 ± 0.0056 ms 0.0998 ± 0.0052 ms 0.988
utils/count_constant_nodes/break_sharing 9.06 ± 0.23 μs 8.37 ± 0.21 μs 1.08
utils/count_constant_nodes/preserve_sharing 0.0852 ± 0.0045 ms 0.0865 ± 0.0041 ms 0.986
utils/count_depth/break_sharing 9.59 ± 0.21 μs 9.96 ± 0.42 μs 0.964
utils/count_nodes/break_sharing 8.37 ± 0.18 μs 8.4 ± 0.23 μs 0.996
utils/count_nodes/preserve_sharing 0.0864 ± 0.0046 ms 0.0867 ± 0.0038 ms 0.997
utils/get_set_constants!/break_sharing 0.0332 ± 0.0029 ms 0.0336 ± 0.0024 ms 0.989
utils/get_set_constants!/preserve_sharing 0.179 ± 0.0086 ms 0.18 ± 0.0096 ms 0.997
utils/get_set_constants_parametric 0.0443 ± 0.0027 ms 0.0455 ± 0.0031 ms 0.973
utils/has_constants/break_sharing 4.14 ± 0.13 μs 4.3 ± 0.2 μs 0.962
utils/has_operators/break_sharing 1.98 ± 0.052 μs 2.21 ± 0.1 μs 0.896
utils/hash/break_sharing 22.7 ± 0.65 μs 23 ± 0.65 μs 0.987
utils/hash/preserve_sharing 0.0974 ± 0.005 ms 0.0991 ± 0.0047 ms 0.983
utils/index_constant_nodes/break_sharing 25.1 ± 1.5 μs 25.3 ± 1.3 μs 0.99
utils/index_constant_nodes/preserve_sharing 0.0987 ± 0.0046 ms 0.0986 ± 0.0046 ms 1
utils/is_constant/break_sharing 4.62 ± 0.13 μs 4.15 ± 0.18 μs 1.11
utils/simplify_tree/break_sharing 0.176 ± 0.0083 ms 0.174 ± 0.0075 ms 1.01
utils/simplify_tree/preserve_sharing 0.223 ± 0.0091 ms 0.222 ± 0.0092 ms 1
utils/string_tree/break_sharing 0.463 ± 0.017 ms 0.487 ± 0.023 ms 0.951
utils/string_tree/preserve_sharing 0.583 ± 0.032 ms 0.584 ± 0.025 ms 0.999
time_to_load 0.21 ± 0.0017 s 0.216 ± 0.0041 s 0.974

@MilesCranmer MilesCranmer merged commit 0f04769 into master Feb 28, 2025
14 checks passed
@MilesCranmer MilesCranmer deleted the allow-pretty-operators branch February 28, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants