octave-tablicious
octave-tablicious copied to clipboard
Tablicious regexprep() fails with "undefined demote_strings()"
WIth Octave 9.3.0 (didn't try other versions) and Tablcious 0.4.4 or 0.4.3 I experience
s = string("a/b//c");
d = regexprep(s, "/+", "/"));
error: 'demote_strings' undefined near line 732, column 14 error: called from regexprep at line 732 column 12
Uh oh. Don't bother testing other Octave versions; that's surely an internal Tablicious bug. I'll get on it.
Thanks!
Note that Octave package datatypes includes a "string" class, in case it's ultimately considered to use that package.
Here's a fix, I think, on branch apj/fix-string-regexprep-demote_strings. Problem was that demote_strings(), as an instance method, didn't work on arrays which contain no string elements, and a couple methods like regexprep use varargin for just trailing optional args, so it might not contain any string elements. That branch also gets the test suite kind of running again, to validate this change under Octave >= 8.1.
I'll probably roll an 0.4.5 release with this fix later today or tomorrow.
Thanks for the report!
Tests seem to be passing under Octave 6.2, 9.4, and 10.1 with this change. LGTM; I'll roll the release later today if no problems crop up.
>> ver
----------------------------------------------------------------------
GNU Octave Version: 9.4.0 (hg id: df465cbba05a)
GNU Octave License: GNU General Public License
Operating System: Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:26 PDT 2025; root:xnu-11417.121.6~2/RELEASE_X86_64 x86_64
>> cd repos/octave-repos/octave-tablicious/
>> addpath inst
>> tblish.internal.runtests
Processing files in /Users/janke/repos/octave-repos/octave-tablicious/inst:
warning: load_path: inst: No such file or directory
warning: called from
oruntests>run_all_tests at line 75 column 13
oruntests at line 62 column 5
runtests at line 18 column 5
warning: load-path: update failed for 'inst', removing from path
warning: called from
oruntests>run_all_tests at line 75 column 13
oruntests at line 62 column 5
runtests at line 18 column 5
NaS.m ....................................................... PASS 1/1
missing.m ................................................... PASS 2/2
The following files in /Users/janke/repos/octave-repos/octave-tablicious/inst have no tests:
NaC.m colvecfun.m hours.m istabular.m scalarexpand.m todatetime.m
NaT.m contains.m iscalendarduration.m istimetable.m seconds.m vartype.m
array2table.m days.m iscategorical.m localdate.m size2str.m vecfun.m
caldays.m discretize.m isdatetime.m milliseconds.m splitapply.m years.m
calmonths.m dispstrs.m isduration.m minutes.m struct2table.m
calyears.m eqn.m isnanny.m pp.m tail.m
cell2table.m head.m istable.m proxykeysForMatrixes.m timezones.m
>>
>>
>> addpath inst
>> addpath inst/t
>> addpath ~/repos/octave-repos/mptest/lib
>> tblish_test_tablicious
t_00_dummy_mptest_check....ok (1 of 4 skipped)
t_01_table.................ok (1 of 237 skipped)
All tests successful (239 passed, 2 skipped of 241)
Elapsed time 0.58 seconds.
>>
Fix merged in https://github.com/apjanke/octave-tablicious/commit/e203839a9c0c28397a742812add25b799f059b64.
Tablicious 0.4.5 is out now, with this fix. Sorry that took so long! And thanks again for the fix.
https://github.com/apjanke/octave-tablicious/releases/tag/v0.4.5
Note that Octave package datatypes includes a "string" class, in case it's ultimately considered to use that package.
I don't think there will be any interoperability between Tablicious and datatypes. It looks like the datatypes package is intended as a complete replacement for Tablicious, with alternative implementations for everything that Tablicious provides. I'm guessing this grew out of this thing back in early 2024 when we talked about interoperability between Tablicious and the statistics package, and it did not go well. Looks like datatypes is statistics guy basically saying "bah, I can do this better". And he's probably right. He's a better Octave programmer than me, and more involved in the core Octave community, and can make statistics interoperability happen. So, the existence of datatypes means that Tablicious is basically dead as a project, and there's no point in making significant changes to support interop here. Probably the way forward is adopting datatypes, and viewing Tablicious as having a historical role in making that project happen.