x3042 / ExactODEReduction.jl

Exact reduction of ODE models via linear transformations
MIT License
13 stars 3 forks source link

For history: natural sorting of variables #28

Closed sumiya11 closed 1 year ago

sumiya11 commented 1 year ago

Our parser currently sorts variables from the input files based on usual lex. I think we could use lt=natural from NaturalSort.jl instead. cc @pogudingleb

vars = ["x3", "x1", "x8", "x9", "x4", "x12", "x2", "x5", "x10", "x6", "x11", "x7"];

sort(vars)
# ["x1", "x10", "x11", "x12", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9"]

using NaturalSort
sort(vars, lt=natural)
# ["x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12"]
pogudingleb commented 1 year ago

Good idea!