#] #] ********************* #] "$d_Qtest"'QNial test notes.txt' - specific to "$d_Qtest"'QNial test optrs.ndf', not for other .ndfs!! # www.BillHowell.ca 23Nov2021 initial # view this file in a text editor, with [constant width font, tab = 3 spaces], no line-wrap # Instructions : # all tstOptrPhr MUST use the ACTUAL (executable) optr name + end with '_test'!! # 08Apr2022 how do I arrange for multiple test versions? use _test1 etc - ie chop off after '_test...' # to adjust test loaddefs, see : 'QNial setup.ndf' # directory "d_Qndfs"'QNial [symbol, arg] changes/' - optrs etc to change symbols across system # '0_QNial symbol notes.txt' # '1_QNial symbol plan.txt' # '3_QNial symbol - draft listings to use for changes.txt' # To revamp all QNial symbols : see "$d_Qndfs"'QNial [symbol, arg] changes/0_0_QNial symbol notes.txt' 48************************************************48 24************************24 # Table of Contents, generated with : # $ grep "^#]" "$d_Qtest"'QNial test notes.txt' | sed 's/^#\]/ /' # ********************* "$d_Qtest"'QNial test notes.txt' - res ipsa loquitor 25Apr2022 [create, test] idx [optr,tst]s, fix [itm, sub]*[optr,tst]s 22Apr2022 tests that failed : atm_lst01, 2], atm_ary01, lst_lst10, ?spAllia4 21Apr2022 fix tstOptrs 20Apr2022 sub_posnA1stItmInTop_ary works beautifully - but can I get rid of the list-specific coding? 19Apr2022 fix optrs [indx_compatible_ary, ary_indx_getAllSlc, ary_itm_getSlcA, itm_posnAInTop_ary, sub_posnA1stItmInTop_ary] 17Apr2022 fix ary_indx_getAllSlc 15Apr2022 AWESOME!! : bash "$d_bin"'linux.sh' - key cmds cart [options, usage], txtEd for full view 14Apr2022 create tests slc - INDEX of "full-and-all-axis" split of an array itm_posn1stInTop_ary_testStd := - posnL of 1st chr of Substr in Str, or null itm_posnAInTop_ary IS OP itm ary - posnA of itm in TOP level of ary, or null (not useful?) or null. itm MUST be an "element" of lst, eg (0 1) in ((0 1) 2 3 4 5), not in (0 1 2 3 4 5) ary_getAllSlcPermutations IS OP ary - 14Apr2022 was this for [reverse list, transposed] searches? ??? where am I going with this? 13Apr2022 groupTest "ary_restruct_groupTest 13Apr2022 sub_posnAAllItmInTop_ary fails with isLst sub 12Apr2022 atomA_restructSameAs_ary_test, other ary tests 11Apr2022 itm_posn1stInTop_ary_test, itm_posnAInTop_ary, sub_posnA1stItmInTop_ary 10Apr2022 start testing with 'arrays/arrays- testOptrs.ndf' 10Apr2022 08Apr2022 where am I? would like fileops to work in order to do backups 07Apr2022 revamp link d_Qtest 'QNial test optrs.ndf' - simplify args (use phrases) 06Apr2022 fix tstSimple - to accept testName as string, not phrase 05Apr2022 fix boolA_cut_ary (see "d_Qtest"'boolean/boolean- develop.txt'), then rerun tests 05Apr2022 fix clusterTest in 'QNial test optrs.ndf' - I need overall summaries (too many tests!!) 05Apr2022 allow for bash summary of [group, cluster] tests based on individual test log outputs 05Apr2022 I need overall summaries of [group, cluster] tests (too many tests!!) 04Apr2022 resume work - where am I? 15Feb2022 'QNial test optrs.ndf' continue revamp 14Feb2022 string tests - many tests listed don't exist yet operators may have changed names (eg lst, ary, etc] 13Feb2022 revamp [tstSimple, tstDatStd, group_simpleTest], add write_tstResults 13Feb2022 'QNial test optrs.ndf' created groupTest, renamed allTest -> clusterTest 12Feb2022 status- tests on [type, fault, boolean, array, list, string, file_op, window]s 23Nov2021 update [tstSimple, group_subDir_test] 24Nov2021 move ary position tests from 'strings- tests.ndf' to 'array- tests.ndf' 24************************24 #] +-----+ #] ToDos ??Feb2022 strings.ndf - handy to build programmer's aide to select optrs : sub_splitSeparate_str IS sub_splitSeparate_lst str_subP_splitSeparateTo_midIndxs_subL IS lst_subP_splitSeparateTo_midIndxs_subL 04Apr2022 perhaps just an operator that generates potential candidates, DON'T add a huge # of new symbols to workspace!! 08Apr2022 must revamp [ary, bool] optrs - slices must be used for ary, not boolA!!! 08Apr2022 how do I arrange for multiple test optrs? use _test1 etc - ie chop off after '_test...' 08Apr2022 strURL_clean IS OP str - need to fix ary_replace_subP (slice or bool list optr) 11Apr2022 sub_posnAAllItmInTop_ary unresolved structures of resultL 11Apr2022 subL_posnAAllItmInTop_ary - what a mess!! 13Apr2022 still a problem with following, but go on to next group, come back later : sub_posnAAllItmInTop_ary_testStd | 25| 0| 27| subL_posnAAllItmInTop_ary_testSimple| 5| 0| 14| subL_posnAAllItmInTop_ary_testStd | 0| 0| 27| 19Apr2022 "$d_Qtest"'slice notes.txt' - learn very powerful tool! (after so many decades - I'm slow) 20Apr2022 need to add sub_indx_to_slice tests to 'arrays- testOptrs.ndf' 20Apr2022 need to add new tests for sub_posnA1stItmInTop_ary to 'arrays- testOptrs.ndf' 21Apr2022 sub_posnA1stItmInTop_ary - create a new tstSimple with example list 'arrays- data templates.ndf' 05May2022 ary_chk_idxA_to_slc_testSimple, >> OK, all work, but : I don't properly understand the solitaries shape of results for a simple ary is NOT the same as idxA : important for later use!!! ary_idxA_to_slc : want shape result = shape idxA (eg pull sub from ary)!!!! maybe { (gage shape idxA) reshape (ary EACHRIGHT ary_idx_to_slc idxA) } # re-order tstDatArgs for "tstSimple 2" - geany regexpr # search : \t\"(.*)\n(.*)\n(.*)\n(.*)\n(.*)\n # replace : \t\"\1\n\3\n\2\n\4\n\5\n sequencing of testing follows p_Qsetup= link d_Qndfs 'QNial setup.ndf' # standard loaddefs : EACH loaddefs (link d_Qndfs 'QNial setup - header.ndf') (link d_symbols 'QNial userWkspSymbol header.ndf') (link d_symbols 'QNial userWkspSymbol.ndf') * (link d_Qndfs 'types.ndf') - spread out in files below? * (link d_Qndfs 'faults.ndf') - used by [op, test]s, errMsgs 'faults - header.ndf'? (link d_Qndfs 'boolean.ndf') - OK [ops, clus] (link d_Qndfs 'arrays.ndf') - OK [ops, group, clus] (link d_Qndfs 'lists.ndf') - NYET - in [ary,str]s? (link d_Qndfs 'strings.ndf') - OK [ops, group, clus] (link d_Qndfs 'file_ops.ndf') - special style, need to udate AFTER fix optrs above (link d_Qndfs 'windows.ndf') - NYET nothing yet (link d_Qndfs 'encryption.ndf') - NYET nothing yet (link d_Qndfs 'math - [quick, handy] stuff.ndf') - NYET nothing yet Also, many other [op, group, clus]... Legend : * a few tests in .ndf file optr change : +.....+ +.....+ To : +.....+ +.....+ #] +-----+ 24************************24 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] ??Mar2024 08********08 #] 21Mar2024 create "d_types [atomic, nested]- *[develop[, TblOfContents].txt, .ndf]" rename [dir, fil]s, also in Qtest 08********08 #] 11Apr2023 "$d_Qtest"'QNial test optrs.ndf' tests don't work (again!!) 08********08 #] 30Mar2023 tstSimple fails with only one arg This was a STUPID mistake, 'fault' was declared as a local variable!! I didn't even know you could do that see "$d_Qtest"'types/types- develop.txt' change : THEN calcL := optrPhr EACHRIGHT apply first datCols ; to : THEN calcL := optrPhr EACHRIGHT apply datCols ; first check, see : "$d_Qtest"'types/types- testOptrs.ndf' loaddefs link d_Qtest 'QNial test optrs.ndf' tstOptr "ary_adrCompatible_testSimple "$d_Qtests"'types/test results/'ary_adrCompatible_testSimple log.txt' ?conform error in catenate change : THEN calcL := optrPhr EACHRIGHT apply datCols ; to : THEN calcL := optrPhr EACHRIGHT apply first datCols ; >> back to : +--+----------+------------+------------------------+ |OK|test# |std |calc | +--+----------+------------+------------------------+ | o|null01 |?aryAdrComp2|+---------+------------+| | | | ||?no_value|?aryAdrComp2|| | | | |+---------+------------+| +--+----------+------------+------------------------+ | o|atm01 |?aryAdrComp1|+---------+------------+| | | | ||?no_value|?aryAdrComp1|| | | | |+---------+------------+| +--+----------+------------+------------------------+ | l|lst01 | l| l| +--+----------+------------+------------------------+ | l|indx_lst01| l| l| +--+----------+------------+------------------------+ flag_break it 08********08 #] 15Sep2022 ary_chk_sub_find_idxLL_testStd >> simple fixes as with ary_chk_sub_find_idx1stL_testStd 08********08 #] 14Sep2022 "$d_Qtest"'arrays/arrays- testOptrs.ndf' - continue work on this a bit before goint to fileops +-----+ ary_posn_groupTest typical error : ?itm_chk_findAll_ary_testStd error : unknown tstTypPhr >> Hah! optrNames were all switched around! problem is in groupTests : "$d_Qtest"'arrays/arrays- testGroupsCluster.ndf' +-----+ - first check arg[order, number] of tests - then check optr itself +--+-------------------------+-------+------+-----+ |OK|test (group) |correct|faults|total| +--+-------------------------+-------+------+-----+ | o|ary_restruct_groupTest | 10| 30| 40| easy - albeit, had to fix 2 optrs +--+-------------------------+-------+------+-----+ | o|ary_posn_groupTest | 22| 27| 27| tstStd - reversed all datArgs +--+-------------------------+-------+------+-----+ | o|ary_slice_groupTest | 112| 148| 158| +--+-------------------------+-------+------+-----+ | o|ary_split_groupTest | 0| 10| 10| +--+-------------------------+-------+------+-----+ | o|ary_hold_groupTest |?A | 7| 13| +--+-------------------------+-------+------+-----+ | o|ary_cut_groupTest | 0| 3| 3| +--+-------------------------+-------+------+-----+ | o|ary_sort_groupTest | 0| 5| 5| +--+-------------------------+-------+------+-----+ | o|ary_cullOption_groupTest | 0| 3| 3| +--+-------------------------+-------+------+-----+ | o|ary_database_groupTest |?A |?A |?A | +--+-------------------------+-------+------+-----+ | o|ary_transformer_groupTest| 0| 14| 14| +--+-------------------------+-------+------+-----+ copied [template, optr] test#'s to grep '"' '/mnt/ramdisk/optr tstL.txt' | sed 's|\t||' grep '"' '/mnt/ramdisk/template tstL.txt' | sed 's|\t||' # change ALL test #'s for tstStandard # geany must be in order optr -> tmplt names # $ sed ' s|\d34null_null01|"null_null01|; s|\d34atm_null01|"null_atm01x|; s|\d34lst_null01|"null_lst01x|; s|\d34null_atm01|"atm_null01|; s|\d34atm_atm01|"atm_atm01|; s|\d34atm_atm02|"atm_atm02|; s|\d34null_lst01|"lst_null01|; s|\d34atm_lst01|"lst_atm01|; s|\d34atm_lst02|"lst_atm02|; s|\d34lst_lst01|"lst_lst01|; s|\d34lst_lst02|"lst_lst02|; s|\d34lst_lst03|"lst_lst03|; s|\d34lst_lst04|"lst_lst04|; s|\d34lst_lst05|"lst_lst05|; s|\d34lst_lst06|"lst_lst06|; s|\d34lst_lst07|"lst_lst07|; s|\d34lst_lst08|"lst_lst08|; s|\d34lst_lst09|"lst_lst09|; s|\d34lst_lst10|"lst_lst10|; s|\d34lst_lstL01|"lstL_lst01x|; s|\d34lstL_lst01|"lst_lstL01|; s|\d34lstL_lst02|"lst_lstL02|; s|\d34lstL_lstL01|"lstL_lstL01|; s|\d34atm_ary01|"ary_atm01|; s|\d34lst_ary01|"ary_lst01|; s|\d34lst_ary02|"ary_lst02|; s|\d34ary_ary01|"ary_ary01|; s|\d34atm_null01x|"null_atm01|; s|\d34lst_null01x|"null_lst01|; s|\d34lst_lstL01x|"lstL_lst01|; sed 's|\d34null_null01|"null_null01|;s|\d34atm_null01|"null_atm01x|;s|\d34lst_null01|"null_lst01x|;s|\d34null_atm01|"atm_null01|;s|\d34atm_atm01|"atm_atm01|;s|\d34atm_atm02|"atm_atm02|;s|\d34null_lst01|"lst_null01|;s|\d34atm_lst01|"lst_atm01|;s|\d34atm_lst02|"lst_atm02|;s|\d34lst_lst01|"lst_lst01|;s|\d34lst_lst02|"lst_lst02|;s|\d34lst_lst03|"lst_lst03|;s|\d34lst_lst04|"lst_lst04|;s|\d34lst_lst05|"lst_lst05|;s|\d34lst_lst06|"lst_lst06|;s|\d34lst_lst07|"lst_lst07|;s|\d34lst_lst08|"lst_lst08|;s|\d34lst_lst09|"lst_lst09|;s|\d34lst_lst10|"lst_lst10|;s|\d34lst_lstL01|"lstL_lst01x|;s|\d34lstL_lst01|"lst_lstL01|;s|\d34lstL_lst02|"lst_lstL02|;s|\d34lstL_lstL01|"lstL_lstL01|;s|\d34atm_ary01|"ary_atm01|;s|\d34lst_ary01|"ary_lst01|;s|\d34lst_ary02|"ary_lst02|;s|\d34ary_ary01|"ary_ary01|;s|\d34atm_null01x|"null_atm01|;s|\d34lst_null01x|"null_lst01|;s|\d34lst_lstL01x|"lstL_lst01|;' "$d_Qtest"'arrays/arrays- testOptrs.ndf' >"$d_temp"'optrs revamped.txt' +-----+ now re-try ary_posn_groupTest groupTest "ary_posn_groupTest ary_chk_sub_find_idx1stL_testStd >> complete failure, many ?not an operation ary_chk_sub_find_idx1stL IS OP sub ary >> reversed args! ary_chk_sub_apply_optrPhr ary sub "sub_posnA1stItmInTop_ary >> wrong optrName -> ary_sub_find_idx1stL +--+-----------+----------------+--------------+ | o|lst_atm01 |3 8 12 |l 3 8 12 | +--+-----------+----------------+--------------+ >> returns Bool AND result fixed resFltL handling in ary_sub_find_idx1stL IS OP ary sub # Notes : # (1) I still don"t understand fully... and calc = std but still wrong? (subr modified?)' # loaddefs link d_Qtest 'arrays/arrays- testOptrs.ndf' # 23Apr2022 retain all thests as valuable reference... # +-----+ # 21Apr2021 tests qnial> a := ary_sub_find_idxLL '_test' 'itm_posnAInTop_ary_testStd' +--------------+ |18 19 20 21 22| +--------------+ >> OK, remember - first itm only, which = `_ # 23Apr2021 tests qnial> a := ary_sub_find_idxLL ` 'the bigg fat cow' ?spAllia4 qnial> [valence, gage shape] a +-++ |0|| +-++ qnial> a := ary_sub_find_idxLL 4 (tell 10) ?spAllia4 qnial> [valence, gage shape] a +-++ |0|| +-++ qnial> a := ary_sub_find_idxLL '[#=; backtrack ;=#]Howell - Mega-Life, Mega-Death and the Sun, the rise and f_lstl of civilisations.pdf' '[#=; backtrack ;=#]' ?sp1ia2 qnial> [valence, gage shape] a +-++ |0|| +-++ qnial> a := ary_chk_sub_find_idxLL 4 (4 5 reshape (tell 30)) +-----+ |+---+| ||0 4|| |+---+| +-----+ qnial> [valence, gage shape] a 1 1 "lst_ary02 qnial> a := ary_chk_sub_find_idxLL (4 5) (4 5 reshape (tell 30)) ?spAllia4 qnial> [valence, gage shape] a +-++ |0|| +-++ "ary_ary01 qnial> a := ary_chk_sub_find_idxLL (2 3 reshape 1 2 3 6 7 8) (4 5 reshape (tell 30)) +-------------+ |+---+---+---+| ||0 1|0 2|0 3|| |+---+---+---+| ||1 1|1 2|1 3|| |+---+---+---+| +-------------+ qnial> [valence, gage shape] a 1 1 # +-----+ +-----+ ary_chk_sub_find_idxLL_testStd >> simple fixes as with ary_chk_sub_find_idx1stL_testStd +-----+ olde code ary_sub_compatible IS OP ary sub { LOCAL aryVlc subVlc faultL ; % ; faultL := ary_adrCompatible ary ; faultL := link faultL (sub_adrCompatible sub) ; % ; IF (NOT ary_hasFaults faultL) THEN faultL := null ; IF (~= (EACH valence ary sub)) THEN faultL := fault '?aryComSub1' ; ELSEIF (OR (EACHBOTH > (EACH (gage shape) sub ary)) THEN faultL := fault '?aryComSub2' ; ENDIF ; ENDIF ; IF (= null faultL) THEN l ELSE faultL ENDIF } # fault codes (can't have apos! use quotes) : #? ary_sub_compatible ?aryComSub1 - (~= subVlc aryVlc), sub must be "up-dimensioned" if subVal < aryVal #? ary_sub_compatible ?aryComSub2 - (OR (EACHBOTH > sub ary)) sub too large along at least one axis Change : +-----+ ary_itm_find_idxL IS OP ary itm { LOCAL resFlt ; resFlt := itm findall ary ; IF (= null resFlt) THEN resFlt := [fault '?itmNotInAry'] ; ENDIF ; To : +-----+ ary_itm_find_idxL IS OP ary itm { LOCAL resFlt ; resFlt := itm findall ary ; IF (= null resFlt) THEN resFlt := fault '?itmNotInAry' ; ENDIF ; # 23Apr2021 tests # "lst_lst10 qnial> a := sub_posnA1stItmInTop_ary '[#=; backtrack ;=#]Howell - Mega-Life, Mega-Death and the Sun, the rise and f_lstl of civilisations.pdf' '[#=; backtrack ;=#]' ?sp1ia2 qnial> [valence, gage shape] a +-++ |0|| +-++ >>This would be forced to [1][1] by sub_makeVlcSameAs_ary in sub_posnA1stItmInTop_ary # 08********08 # 21Apr2022 sub_posnA1stItmInTop_ary I need to create a new tstSimple with the following : # tests of is[Atm, Lst] sub : # qnial> sub_posnA1stItmInTop_ary 4 (link (tell 10) (tell 10) (4 5)) # 4 14 20 # qnial> sub_posnA1stItmInTop_ary [4] (link (tell 10) (tell 10) (4 5)) # 4 14 20 # qnial> sub_posnA1stItmInTop_ary (4 5) (link (tell 10) (tell 10) (4 5)) # 4 14 20 # testsf tables (2D arys) # qnial> 5 6 reshape (tell 30) # 0 1 2 3 4 5 # 6 7 8 9 10 11 # 12 13 14 15 16 17 # 18 19 20 21 22 23 # 24 25 26 27 28 29 # qnial> sub_posnA1stItmInTop_ary 4 (5 6 reshape (tell 30)) # +---+ # |0 4| # +---+ # qnial> 5 6 reshape (tell 5) # 0 1 2 3 4 0 # 1 2 3 4 0 1 # 2 3 4 0 1 2 # 3 4 0 1 2 3 # 4 0 1 2 3 4 # qnial> sub_posnA1stItmInTop_ary (1 1 reshape 4 ) (5 6 reshape (tell 30)) # +---+ # |0 4| # +---+ # qnial> sub_posnA1stItmInTop_ary (1 2 reshape 4 5) (5 6 reshape (tell 30)) # +---+ # |0 4| # +---+ # qnial> 5 6 reshape (tell 5) # 0 1 2 3 4 0 # 1 2 3 4 0 1 # 2 3 4 0 1 2 # 3 4 0 1 2 3 # 4 0 1 2 3 4 # qnial> sub_posnA1stItmInTop_ary (1 1 reshape 4 ) (5 6 reshape (tell 5)) # +---+---+---+---+---+---+ # |0 4|1 3|2 2|3 1|4 0|4 5| # +---+---+---+---+---+---+ # qnial> 5 6 reshape 3 4 5 # 3 4 5 3 4 5 # 3 4 5 3 4 5 # 3 4 5 3 4 5 # 3 4 5 3 4 5 # 3 4 5 3 4 5 # qnial> sub_posnA1stItmInTop_ary (1 2 reshape 4 5) (5 6 reshape 3 4 5) # +---+---+---+---+---+---+---+---+---+---+ # |0 1|0 4|1 1|1 4|2 1|2 4|3 1|3 4|4 1|4 4| # +---+---+---+---+---+---+---+---+---+---+ 08********08 #] 13Sep2022 'QNial test optrs.ndf' not working (yet again and again and again...) see also "$d_Qmkts"'0_PuetzUWS intnl stocks notes.txt' ary_to_atmL_testSimple ?.. Optrphr := phrase ( ( first first ( '_test' ary_sub_find_idxll Testoptrstr ) ) take Testoptrstr ) -->[nextv] ?left argument in take must be integers >> switch argOrder! '_test' ary_sub_find_idxll Testoptrstr OK, now it works Try ary test groups : >> oops, tstStandard not working, try one of those ary_chk_itm_find_idxL_testStd >> runs OK, many problems with optr! Simply look at them all : clusterTest "arrays_testCluster what a mess... most optrs don't work clusterTest "strings_clusterTest almost all work groupTest "fault_groupTest all good fileops - tests are run individually boolean - forget it, have to renname extensively to run types - total mess too 08********08 #] 22Jun2022 RE-restart work after even more time on Pine Script garbage ary_slice_groupTest start time : 22Jun2022 19h15m41s +--+---------------------------------------+-------+------+-----+ |OK|test (optr) |correct|faults|total| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_compatible_idx_testSimple | 19| 26| 27| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idx_getAllSlc_testSimple | 0| 22| 24| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_itm_getAllSlc_testSimple | 11| 25| 22| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_itm_getAllSlc_to_itm_testSimple| 0| 23| 22| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idx_to_slc_testSimple | 8| 5| 27| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idxA_to_slc_testSimple | 11| 4| 27| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_slc_to_idx_testSimple | 0| 24| 24| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_sub_getAllSlc_testSimple | 0| 23| 21| +--+---------------------------------------+-------+------+-----+ | o|sub_chk_idx_to_slc_testSimple | 9| 32| 24| +--+---------------------------------------+-------+------+-----+ | o|ary_invert_slc_testSimple | 0| 21| 21| +--+---------------------------------------+-------+------+-----+ | o|ary_invert_slcA_testSimple | 0| 21| 21| +--+---------------------------------------+-------+------+-----+ tests or optr not created yet : ary_axsTitles_titleL_getSlc_testStd finish time : 22Jun2022 19h15m46s 08********08 #] 04Jun2022 restart work after 2 months on Pine Script garbage #] ary_slice_groupTest - this group has to work BEFORE proceeding on others qnial> clusterTest "arrays_testCluster ARRAYS_TESTCLUSTER : all group tests fail 100%?!?? >> wrong output as several groups have successful results Key group : ary_slice_groupTest start time : 4Jun2022 20h19m28s +--+---------------------------------------+-------+------+-----+ |OK|test (optr) |correct|faults|total| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idx_to_slc_testSimple | 8| 5| 27| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idxA_to_slc_testSimple | 11| 4| 27| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_slc_to_idx_testSimple | 0| 24| 24| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_idx_getAllSlc_testSimple | 0| 22| 24| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_itm_getAllSlc_testSimple | 11| 25| 22| +--+---------------------------------------+-------+------+-----+ | o|ary_chk_itm_getAllSlc_to_itm_testSimple| 0| 23| 22| +--+---------------------------------------+-------+------+-----+ | o|ary_shapeChk_sub_getAllSlc_testSimple | 0| 23| 21| +--+---------------------------------------+-------+------+-----+ | o|sub_chk_idx_to_slc_testSimple | 0| 24| 24| +--+---------------------------------------+-------+------+-----+ tests or optr not created yet : ary_axsTitles_titleL_getSlc_testStd ary_invert_slc_testStd ary_invert_slcA_testStd finish time : 4Jun2022 20h19m28s 08********08 #] 09May2022 slice tests ary_slice_groupTest >> all are fault '?not an operation' tstOptr "ary_chk_idx_to_slc_testSimple >> all are fault '?not an operation' in tstSimple : optrPhr := phrase ((first first ('_test' sub_posnAAllItmInTop_ary testOptrStr)) take testOptrStr) ; -->[nextv] optrPhr ?left argument in take must be integers -->[nextv] testOptrStr ary_chk_idx_to_slc_testSimple -->[nextv] '_test' sub_posnAAllItmInTop_ary testOptrStr ?sp1ia4 -->[nextv] sub_posnA1stItmInTop_ary '_test' 'ary_chk_idx_to_slc_testSimple' ?sp1ia4 >> ouch, trickey problem? flag_break, lq_arrays : sub_posnA1stItmInTop_ary '_test' 'ary_chk_idx_to_slc_testSimple' ?.. Slicer := subshp_idx_to_slc Sub Idx -->[nextv] ?shape ?shape ?shape ?shape ?shape > Ah hah, I didn't fix args (many other place as well!) optr change : +.....+ slicer := subShp_idx_to_slc sub idx ; +.....+ To : +.....+ slicer := subShp_idx_to_slc (gage shape sub) idx ; +.....+ ?.. Slicer := subshp_idx_to_slc ( gage shape Sub ) Idx -->[nextv] o-----------+ |7 8 9 10 11| +-----------+ >> oh-oh, why the single? still works? Re-try : qnial> tstOptr "ary_chk_idx_to_slc_testSimple -->[stepv] resume o ary_chk_idx_to_slc_testSimple 15 31 27 >> OK - much better, still problems - possibly gage shape issues or arg orders? "lst01_null [fault '?ixca1'] 'should be OK, error : not defined for isNull idxA' sub_posnA1stItmInTop_ary 'the bigg fat cow' null qnial> EACH [gage shape, valence] null 1 `c [1] (tell 10) +---+----+----+---+----+ |0 1|++-+|++-+|1 1|10 1| | |||0||||0|| | | | |++-+|++-+| | | +---+----+----+---+----+ idx_compatible_aryShp change : +.....+ ELSEIF (1 < idxVlc) THEN faultL := link faultL (fault '?ixca2') ; +.....+ To : +.....+ ELSEIF (1 > idxVlc) THEN faultL := link faultL (fault '?ixca2') ; +.....+ qnial> tstOptr "ary_chk_idx_to_slc_testSimple -->[stepv] resume o ary_chk_idx_to_slc_testSimple 8 37 27 >> even worse than before Changeto : IF (= 0 aryShp) THEN faultL := link faultL (fault '?ixca4') ; ELSEIF (= null aryShp) THEN faultL := link faultL (fault '?ixca5') ; qnial> tstOptr "ary_chk_idx_to_slc_testSimple o ary_chk_idx_to_slc_testSimple 10 31 27 10May2022 qnial> idx_compatible_aryShp >> null qnial> idx_compatible_aryShp `a 'this is a test' ?ixca5 # idx_compatible_aryShp (1 2) (2 3 reshape 10) # # "lst01_null [fault '?ixca1'] 'should be OK, error : not defined for isNull idxA' qnial> idx_compatible_aryShp (gage shape null) 'the bigg fat cow' ?ixca7 Pain in ass - too much re-ordering of test examples with different ering of optrArgs revamp : idx_compatible_aryShp -> aryShp_compatible_idx itmShp_compatible_aryShp -> aryShp_compatible_itmShp subShp_compatible_aryShp -> aryShp_compatible_subShp slc_compatible_aryShp -> aryShp_compatible_slc sub_aryShp_shapeChkTo_subr -> ary_chk_sub_to_subr ary_shapeChk_sub_apply_optrPhr -> ary_chk_sub_apply_optrPhr qnial> tstOptr "ary_chk_compatible_idx_testSimple o ary_chk_compatible_idx_testSimple 2 28 27 >> adapt all answers to compatible +-----+ olde code # loaddefs link d_Qndfs 'types.ndf' IF flag_debug THEN write 'loading sub_aryShp_shapeChkTo_subr' ; ENDIF ; #] sub_aryShp_shapeChkTo_subr IS OP sub aryShp - returns [subr = reshaped to aryVlc, restL] #] subr is sub "boosted" so (= EACH valence sub ary) (i.e. same dimensionality) #] new subr axis added to higher dimensionality by default #] for specific results, user should pre-shape sub or do combinations (eg sub_ary_axs_progression) # 24Apr2022 initial sub_aryShp_shapeChkTo_subr IS OP sub aryShp { LOCAL resFltL subr ; subr := sub_makeVlcSameAs_aryShp sub aryShp ; resFltL := aryShp_compatible_subShp (gage shape subr) aryShp ; % true if compatible, fault if not ; IF resFltL THEN resFltL := subr ; ENDIF ; resFltL } 08********08 #] 08May2022 aryShp as arg for [idx, slc] optrs use "Vlc" for valence, not "Val" aryShp_idxATop -> aryShp_make_idxAll symStr_shape_makeIdxLblA -> aryShp_symStr_make_idxSymAll replace args! -> shape_makeIdxLblA -> aryShp_symStr_make_idxSymAll, args to aryShp symStr -> then delete redundant defn but do I need the "simple" version with no symStr? ary_symStr_makeIdxLblA -> aryShp_symStr_make_idxSymAll now, reboot qnial, look for errors In 'types.ndf' : itm_compatible_ary -> itmShp_compatible_aryShp ary_shape_sub -> sub_makeVlcSameAs_aryShp, switch args sub_compatible_ary -> subShp_compatible_aryShp sub_shapeChk_ary_apply_optrPhr -> ary_shapeChk_sub_apply_optrPhr sub_ary_shapeChkTo_subr-> sub_aryShp_shapeChkTo_subr, args are sub aryShp slc_compatible_ary -> slc_compatible_aryShp NYET! don't do this, keep it general, handles both [itm, ary]*[, Shp]!!! ary_chk_idx_apply_optrPhr -> aryShp_chk_idx_apply_optrPhr Do NOT reverse changes to : slc_compatible_ary -> slc_compatible_aryShp itm_compatible_ary -> itmShp_compatible_aryShp sub_compatible_ary -> subShp_compatible_aryShp Verify : gage shape [ary, idx, slc] -> Shp must NOT be in args, calced in optr ary_chk_idx_apply_optrPhr IS OP ary idx optrPhr - checks args with argOrder (ary idx) ary_chk_idxA_apply_optrPhr IS OP ary idxA optrPhr - checks args with argOrder (ary idxA) ary_chk_itm_apply_optrPhr IS OP ary itm optrPhr - checks args with argOrder (ary itm) ary_shapeChk_sub_apply_optrPhr IS OP ary sub optrPhr - checks args with argOrder (ary sub) ary_chk_slc_to_indx_apply_optrPhr IS OP ary slc optrPhr - checks args with argOrder (ary slc) Now, make same changes in [arrays.ndf, arrays- testOptrs.ndf] + itm_compatible_ary -> itmShp_compatible_aryShp * ary_shape_sub -> sub_makeVlcSameAs_aryShp, switch args * sub_compatible_ary -> subShp_compatible_aryShp * sub_shapeChk_ary_apply_optrPhr -> ary_shapeChk_sub_apply_optrPhr *+ sub_ary_shapeChkTo_subr-> sub_aryShp_shapeChkTo_subr, args are sub aryShp *+ slc_compatible_ary -> slc_compatible_aryShp * not in [arrays.ndf, ] + not in 'arrays- testOptrs.ndf' in arrays.ndf, ary_itm_getAllSlc called itmShp_compatible_aryShp -> WRONG!!, must pre-use ary_chk_itm_apply_optrPhr, I removed the check from optr in 'arrays- testOptrs.ndf' fixed subL_posnAAllItmInTopChkinp_ary IS OP subL ary for slices in [arrays.ndf, arrays- testOptrs.ndf] : /+ ary_idx_getAllSlc -> aryShp_idx_getAllSlc [itm, sub] stay the same * not in [arrays.ndf, ] / not in types.ndf + not in 'arrays- testOptrs.ndf' [idx, slc] optrs - which have tests? aryShp_make_idxAll no test yet aryShp_symStr_make_idxSymAll no test yet aryShp_idx_to_slc ary_chk_idx_to_slc aryShp_idxA_to_slc ary_chk_idxA_to_slc aryShp_slc_to_idx ary_chk_slc_to_idx aryShp_slcA_to_idxAA no test yet subShp_idx_to_slc no test yet aryShp_idx_getAllSlc ary_chk_idx_getAllSlc ary_itm_getAllSlc ary_chk_itm_getAllSlc, ary_chk_itm_getAllSlc_to_itm ary_sub_getAllSlc ary_shapeChk_sub_getAllSlc ???? sub_chk_idx_to_slc ary_axsTitles_titleL_getSlc ary_invert_slc ary_invert_slcA Changes to : ary_chk_idx_to_slc IS OP ary idx { ary_chk_idx_apply_optrPhr (gage shape ary) idx "aryShp_idx_to_slc } +-----olde code IF flag_debug THEN write 'loading aryShp_symStr_make_idxSymAll' ; ENDIF ; #] aryShp_symStr_make_idxSymAll IS OP aryShp symStr - make ary of shape shapet, elements 'symStr@[i,j]' #] for easily following processes! shapet = desired shape of ary # 15Apr2022 adapted from 'matrix operations - symbolic & real-valued.ndf' aryShp_symStr_make_idxSymAll IS OP aryShp symStr { LOCAL structure subscripts ; IF flag_break THEN BREAK ; ENDIF ; structure := LEAF string (cart EACH tell shapet) ; % LEAF isstring structure - all are false?!? ; subscripts := EACH link (structure EACHLEFT EACHLEFT link ',') ; subscripts := ((EACH (gage shape) subscripts) - 1) EACHBOTH take subscripts } 08********08 #] 06May2022 ary_slc_to_idx - [create, test] # 06May2022 tests # "str01_slcInt 4 'should be OK, note isLst result, no space before isAtm slc' qnial> ary_slc_to_idx 'the bigg fat cow' '[4]' ?slice >> oops, didn't see that coming qnial> ary := 'the bigg fat cow' the bigg fat cow qnial> slc := '[4]' [4] qnial> execute link 'ary|' slc b >> OK, works qnial> ary|[4] b >> confirmation that basic approach should work qnial> ary_slc_to_idx 'the bigg fat cow' '[4]' o-+ |4| +-+ >> no good - don't want single! didn't return a character! qnial> slc [4] qnial> b := ary_idxATop ary +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+ |0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15| +-+-+-+-+-+-+-+-+-+-+--+--+--+--+--+--+ qnial> b|slc ?slice >> hmmm qnial> execute link 'b|' slc o-+ |4| +-+ qnial> execute link '[b|' slc ']' +---+ |o-+| ||4|| |+-+| +---+ qnial> execute link 'first b|' slc 4 >> wow, a bit clumsy, but works # "str02_slc 4 'should fault OK, (~= (valence ary) (gage shape slc))' qnial> ary_slc_to_idx 'abcdefghij' '[ 4]' 4 >> OK # "intA05_intL (2 3) 'should work OK' qnial> ary_slc_to_idx (4 5 reshape (tell 30)) '[ 2, 3]' 2 3 >> OK tstOptr "ary_chk_slc_to_idx_testSimple >> all are ?not an operation, makes sense .. have to create optrs 08********08 #] 05May2022 ary_idxA_to_slc : want shape result = shape idxA (eg pull sub from ary)!!!! maybe { (gage shape idxA) reshape (ary EACHRIGHT ary_idx_to_slc idxA) } optr change : +.....+ ary_idxA_to_slc IS OP ary idxA { ary EACHRIGHT ary_idx_to_slc idxA } +.....+ To : +.....+ ary_idxA_to_slc IS OP ary idxA { (gage shape idxA) reshape (ary EACHRIGHT ary_idx_to_slc idxA) } +.....+ I don't understand the solitarys properly : "ary01_idxA (3 4 reshape (tell 20)) (1 1 reshape 0 4) [fault '?ixca6'] 'should fail OK, not isAtm idxA ' >> why not [[fault '?ixca6']]??? # 05May2022 tests # IF (fault '?test') THEN 1 ELSE 'nofault' ENDIF # 06May2022 tests # "ary02_idxA (EACH solitary (2 3 reshape (fault '?ixca6'))) 'error : not is[Atm,Lst] idxA ' qnial> ary_chk_idxA_apply_optrPhr (4 5 reshape (tell 30)) (2 3 reshape 1 2 3 6 7 8) "ary_idxA_to_slc +------+------+------+ |?ixca6|?ixca6|?ixca6| +------+------+------+ |?ixca6|?ixca6|?ixca6| +------+------+------+ # "lst01_idxAtm ['[4]'] 'should be OK, note isLst result, no space before isAtm idx' ary_chk_idxA_apply_optrPhr 'the bigg fat cow' [4] "ary_idxA_to_slc # "ary01_idxA [[fault '?ixca6']] 'should fail OK, not isAtm idxA, but why the double-solitary?' ary_chk_idxA_apply_optrPhr (3 4 reshape (tell 20)) (1 1 reshape 0 4) "ary_idxA_to_slc >> wicked answer that I couldn't forsee 08********08 #] 05May2022 ary_chk_idxA_to_slc_testSimple - revamp given ary_chk_idx_to_slc qnial> tstOptr "ary_chk_idxA_to_slc_testSimple o ary_chk_idxA_to_slc_testSimple 2 30 27 problem with ary_chk_idxA_apply_optrPhr? optr change : +.....+ ary_chk_idxA_apply_optrPhr IS OP ary idxA optrPhr { LOCAL resFltL ; IF flag_break THEN BREAK ; ENDIF ; IF (OR (isAtm idxA) (= 1 (gage shape idxA))) THEN resFltL := [[idx_compatible_ary idxA ary]] ; ELSE resFltL := idxA EACHLEFT idx_compatible_ary ary ; % true if compatible, fault if not ; ENDIF ; IF (NOT ary_hasFaults resFltL) THEN ary_idxPL := cart [ary] idxA ; resFltL := optrPhr EACHRIGHT apply ary_idxPL ; ENDIF ; resFltL } +.....+ To : +.....+ +.....+ # 05May2022 tests # "lstL01_idx ['[1]'] 'should be OK' ary_chk_idxA_apply_optrPhr ((tell 10) (tell 10) 4 5) [1] "ary_idxA_to_slc # "null01_null (EACH fault '?ixca1' '?ixca4') 'should fail for isNull[idxA, ary], insted null output?' ary_chk_idxA_apply_optrPhr null [null] "ary_idxA_to_slc -->[nextv] ?ixca1 ?ixca4 ?L 05May2022 ary_chk_idxA_to_slc_testSimple, >> OK, all work, but : I don't properly understand the solitaries shape of results for a simple ary is NOT the same as idxA +-----+ olde code # 05May2022 test - see also arrays.ndf qnial> ary_chk_idx_apply_optrPhr null 4 "ary_idxA_to_slc ary_chk_idx_apply_optrPhr null [4] "ary_idxA_to_slc 05May2022 ary_chk_idxA_to_slc_testSimple, >> OK, all work, but : I don't properly understand the solitaries shape of results for a simple ary is NOT the same as idxA 08********08 #] 05May2022 create ary_idx_to_slc, run ary_chk_idx_to_slc_testSimple # "null01_null (EACH fault '?ixca1' '?ixca4') 'error : not defined for isNull[idx, ary]' ary_chk_idx_to_slc null null >> OK tstOptr "ary_chk_idx_to_slc_testSimple create ary_idx_to_slc IS OP ary idx # 05May2022 tests - ary := (4 5 reshape (tell 30)) idxA := cart ((1 1) EACHBOTH + (EACH tell 2 3)) # isNull idx problem # qnial> ary_chk_idx_to_slc null null ?ixca1 ?ixca4 >> OK # qnial> tstOptr "ary_chk_idx_to_slc_testSimple o ary_chk_idx_to_slc_testSimple 8 30 27 >> very interesting 8/27 correct, but NO actual slc values #>> 6 ?not an operation - missing ary_idx_to_slc IS OP ary idxA >> created ary_idx_to_slc - now must adjust standard results for tests # "lst01_idxAtm '[4]' 'should be OK, note isLst result, no space before isAtm idx' ary_chk_idx_to_slc 'the bigg fat cow' 4 >> OK, now problem with idxA - but this is perhaps not allowed? # "lst02_idxL ('[4]' '[5]') '?? should be OK?, I don"t properly understand solitaries etc of results' # qnial> ary_chk_idx_to_slc (tell 10) (4 5) ?ixca7 >> correct answer Most examples lead to faults - I fixed these up : loaddefs link d_Qtest 'arrays/arrays- testOptrs.ndf' # qnial> tstOptr "ary_chk_idx_to_slc_testSimple o ary_chk_idx_to_slc_testSimple 24 23 27 >> much better!! # remaining problem : +--+------------+---------------------+---------------------+ | o|ary05_idx |+------+------+ |[ ?address, ?address]| | | ||?ixca6|?ixca6| | | | | |+------+------+ | | +--+------------+---------------------+---------------------+ | o|ary06_idx |+-------+ |[ ?address, ?address]| | | ||[ 1, 3]| | | | | |+-------+ | | +--+------------+---------------------+---------------------+ # "ary05_idx (EACH (solitary fault) '?ixca6' '?ixca6') 'should work : ??' fonn qnial> ary_chk_idx_to_slc (4 5 reshape (tell 30)) (2 3) # -->[nextv] execute 'idx|[ ,0]' ?slice # execute 'idx|[,0]' ary_idx_to_slc change (olde) : +.....+ ELSE slc := aryVal reshape [', '] ; FOR axis WITH idxANotFull DO slc0 := aryVal reshape [',0'] ; slc0@axis := ', ' ; slc0 := link 'idx|[' (rest link slc0) ']' ; slc@axis := link (' ' EACHRIGHT link (EACH string (axis EACHRIGHT pick (execute slc0))) ) ; ENDFOR ; slc := link '[' (front link (slc EACHLEFT link ',')) ']' ; ENDIF ; +.....+ qnial> ary_chk_idx_to_slc (4 5 reshape (tell 30)) (2 3) [2,3] >> OK qnial> tstOptr "ary_chk_idx_to_slc_testSimple l ary_chk_idx_to_slc_testSimple 27 23 27 But now, problem is compound idx : eg ((1 3) (2 3)) currently this is not allowed but should be? how do I test for a series if idx = idxA? eg ((1 3) (2 3)) vs ([1 3] [2 3]) ; need [isSolitary, ary_hasSolitary] ELSEIF (OR [isSolitary, aryTop_hasSolitary] idx) # execute 'idx|[,0]' - I need to go back to part of earlier code as spaces now missing ary_idx_to_slc change (new version abandoned) : +.....+ ELSE IF flag_break THEN BREAK ; ENDIF ; aryVal := valence ary ; % check all axis to determine which are complete -> slc@ax = null ; idxNotFull := (EACHBOTH NEQ (EACH (gage shape) ary idx)) sublist (tell valence ary) ; IF (ary_hasFaults idxNotFull) THEN faultL := fault '?aixts02' ; ELSE slc := aryVal reshape [', '] ; FOR axis WITH idxNotFull DO slc@axis := EACH string idx@axis ; ENDFOR ; slc := link link '[' (front link (slc EACHLEFT link ',')) ']' ; ENDIF ; ENDIF ; new version works : ELSE slc := aryVal reshape [', '] ; FOR axis WITH idxNotFull DO slc@axis := link (' ' EACHRIGHT link (EACH string idx@axis)) ; ENDFOR ; slc := link link '[' (front link (slc EACHLEFT link ',')) ']' ; ENDIF ; Last problem : "lst01_idxL [fault '?ixca3a'] 'fault is OK : aryTop_hasSolitary idx' ary_chk_idx_to_slc (tell 10) [4] qnial> isSolitary [4] l OR [isSolitary, aryTop_hasSolitary] [4] l >> seems OK? Wait - chop residual code ary_idx_to_slc change (olde) : +.....+ ary_idx_to_slc IS OP ary idx { LOCAL axis aryVal faultL idxNotFull slc ; % ; faultL := null ; IF (= null idx) THEN faultL := fault '?aixts01' ; ELSEIF (isAtm idx) THEN slc := string idx ; slc := link '[' (front link (slc EACHLEFT link ',')) ']' ; ELSEIF (= 1 (gage shape idx)) THEN % assume list of 1!! ; slc := string first idx ; slc := link '[' (front link (slc EACHLEFT link ',')) ']' ; ELSE IF flag_break THEN BREAK ; ENDIF ; aryVal := valence ary ; % check all axis to determine which are complete -> slc@ax = null ; idxNotFull := (EACHBOTH NEQ (EACH (gage shape) ary idx)) sublist (tell valence ary) ; IF (ary_hasFaults idxNotFull) THEN faultL := fault '?aixts02' ; ELSE slc := aryVal reshape [', '] ; FOR axis WITH idxNotFull DO slc@axis := link (' ' EACHRIGHT link (EACH string idx@axis)) ; ENDFOR ; slc := link link '[' (front link (slc EACHLEFT link ',')) ']' ; ENDIF ; ENDIF ; % ; IF (= null faultL) THEN slc ELSE faultL ENDIF } +.....+ To : +.....+ ary_idx_to_slc IS OP ary idx { LOCAL axis aryVal faultL idxNotFull slc ; % ; faultL := null ; IF (isAtm idx) THEN slc := string idx ; slc := link '[' (front link (slc EACHLEFT link ',')) ']' ; ELSE aryVal := valence ary ; % check all axis to determine which are complete -> slc@ax = null ; idxNotFull := (EACHBOTH NEQ (EACH (gage shape) ary idx)) sublist (tell valence ary) ; IF (ary_hasFaults idxNotFull) THEN faultL := fault '?aixts011' ; ELSE slc := aryVal reshape [', '] ; FOR axis WITH idxNotFull DO slc@axis := link (' ' EACHRIGHT link (EACH string idx@axis)) ; ENDFOR ; slc := link link '[' (front link (slc EACHLEFT link ',')) ']' ; ENDIF ; ENDIF ; % ; IF (= null faultL) THEN slc ELSE faultL ENDIF } +.....+ +-----+ olde code # 03May2022 tests - see also ary_chk_idxA_apply_optrPhr in types.ndf "lstL01_idx '[ 1]' 'should be OK' qnial> ary_chk_idxA_to_slc ((tell 10) (tell 10) 4 5) 1 [, ] qnial> ary_chk_idxA_to_slc ((tell 10) (tell 10) 4 5) [1] [ ?address] # ary := (4 5 reshape (tell 30)) idxA := cart ((1 1) EACHBOTH + (EACH tell 2 3)) qnial> ary_idxA_to_slc ary idxA [ 1 2, 1 2 3] # qnial> ary_idxA_to_slc 'the bigg fat cow' 4 [4] # "lst01_idxL '[ 4]' 'should work OK, note that the result is a listL (not obvious from picture output)' qnial> ary_chk_idxA_apply_optrPhr (tell 10) [4] "ary_idxA_to_slc [4] # "lstL01_idx '[1]' 'should be OK' qnial> ary_chk_idxA_apply_optrPhr ((tell 10) (tell 10) 4 5) 1 "ary_idxA_to_slc [1] # "ary01_idxL '[ 0, 4]' 'should work OK' qnial> ary_chk_idxA_apply_optrPhr (3 4 reshape (tell 20)) (0 4) "ary_idxA_to_slc +------+------+ |?ixca6|?ixca6| +------+------+ # "ary02_idxL '[ 2, 3]' 'should work OK' qnial> ary_chk_idxA_apply_optrPhr (4 5 reshape (tell 30)) (2 3) "ary_idxA_to_slc +------+------+ |?ixca6|?ixca6| +------+------+ 08********08 #] 04May2022 slice formats [single, solitary, list, etc] - this will be a BIG problem when using slices!!! Best to have ONE format : a strA (aryTop of strings : including lists, but NOT a string alone) : includes : solitary str (only one str) not [nested, isString, single, solitary str[L,A], etc] all have ('[idxStr1]' '[idxStr2]' '[idxStr3]' ...) structure Nuts - idx_compatible_ary is returning singles. Must fix that. nyet - it's siupposed to return only simple faults Look at ary_chk_idxA_apply_optrPhr resFltL := idxA EACHLEFT idx_compatible_ary ary ; % true if compatible, fault if not ; ary_chk_idx_to_slc_testSimple - has same prolem as : ary_chk_idxA_to_slc_testSimple >> solve the first first!!! # 04May2022 test - see also arrays.ndf # find single? qnial> ary_chk_idxA_apply_optrPhr null 4 "ary_idxA_to_slc o------+ |?ixca4| +------+ fonn ?.. Resfltl := [ Idxa EACHLEFT idx_compatible_ary Ary ] -->[nextv] +--------+ |o------+| ||?ixca4|| |+------+| +--------+ >> yuchh, needs more think qnial> ary_chk_idxA_apply_optrPhr null 4 "ary_idxA_to_slc change to : THEN resFltL := idx_compatible_ary idxA ary ; qnial> ary_chk_idxA_apply_optrPhr null 4 "ary_idxA_to_slc ?ixca4 ary_chk_idxA_apply_optrPhr null [4] "ary_idxA_to_slc change to : THEN resFltL := [idx_compatible_ary idxA ary] ; tstOptr "ary_chk_idxA_to_slc_testSimple -> still gives simple faults, change to faultL change to : IF (OR (isAtm idxA) (= 1 (gage shape idxA)) THEN resFltL := [[idx_compatible_ary idxA ary]] ; >> still gives simple faults # qnial> ary_chk_idxA_apply_optrPhr null 4 "ary_idxA_to_slc 08********08 #] 03May2022 ary_idx_getAllSlc, ary_itm_getAllSlc, ary_sub_getAllSlc, ary_chk_idxA_apply_optrPhr # 03May2022 test qnial> a := ary_chk_itm_getAllSlc_to_itm (4 5 reshape (tell 30)) 2 +-+ |2| +-+ qnial> diagram a +---+ |+-+| ||2|| |+-+| +---+ qnial> diagram first a +-+ |2| +-+ qnial> diagram first first a 2 >> why isn't result correct?!! leave for another time... +-----+ 04May2022 ary_chk_idxA_apply_optrPhr - is key for tests etc ary_chk_idxA_to_slc_testSimple - nothing works!!! WOW! use of picture for assignment in ary_idxA_to_slc : IF (isAtm idxA) THEN slc := string idxA ; ELSEIF (= 1 (gage shape idxA)) THEN slc := picture idxA ; >> not good for return value other than in ary_idxA_to_slc , but a nice touch for some time in the future error : [ ?address] - might be due to "picture" above? definitely case for : | o|ary04_idxL |[ 1, 3] |[+,-,-,-,+,|,1, ,3,|,+,-,-,-,+]| changed to : ELSEIF (= 1 (gage shape idxA)) THEN slc := string first idxA ; % assume list of 1!! ; +-----+ 04May2022 ary_chk_idxA_to_slc_testSimple, why these errors? : isNull ary : slcs OR[are empty, have ?address] isAtm idxA : slcs are single (??) +--+------------+----------------------+-------------------------------+ |OK|test# |std |calc | +--+------------+----------------------+-------------------------------+ | o|null01_null |?ixca1 ?ixca4 |[, ] | +--+------------+----------------------+-------------------------------+ | o|null01_atm |?ixca1 |o------+ | | | | ||?ixca4| | | | | |+------+ | +--+------------+----------------------+-------------------------------+ | o|atm01_null |?ixca1 ?ixca5 |[] | +--+------------+----------------------+-------------------------------+ | o|atm01_atm |?ixca3 ?ixca5 |o-------------+ | | | | ||?ixca3 ?ixca5| | | | | |+-------------+ | +--+------------+----------------------+-------------------------------+ | o|atm02_atm |?ixca5 |o------+ | | | | ||?ixca5| | | | | |+------+ | +--+------------+----------------------+-------------------------------+ | o|lst01_null |?ixca1 |[ ?address] | +--+------------+----------------------+-------------------------------+ | o|lst01_atm |?ixca3 |o------+ | | | | ||?ixca3| | | | | |+------+ | +--+------------+----------------------+-------------------------------+ | o|lst02_atm |?ixca3 |o------+ | | | | ||?ixca3| | | | | |+------+ | ... More ?address problems +--+------------+----------------------+-------------------------------+ | o|lst02_idxL |+---+---+ |[ ?address] | | | ||[4]|[5]| | | | | |+---+---+ | | +--+------------+----------------------+-------------------------------+ | o|lstL01_idxL |+------+------+ |[ ?address] | | | ||?ixca8|?ixca8| | | | | |+------+------+ | | +--+------------+----------------------+-------------------------------+ | o|ary05_idxL |?ixca3 |[ ?address, ?address] | +--+------------+----------------------+-------------------------------+ optr change : +.....+ ary_chk_idxA_apply_optrPhr IS OP ary idxA optrPhr { LOCAL resFltL ; resFltL := idxA EACHLEFT idx_compatible_ary ary ; % true if compatible, fault if not ; IF (NOT ary_hasFaults resFltL) THEN resFltL := apply optrPhr (ary idxA) ; ENDIF ; resFltL } +.....+ To : +.....+ ary_chk_idxA_apply_optrPhr IS OP ary idxA optrPhr { LOCAL resFltL ; resFltL := idxA EACHLEFT idx_compatible_ary ary ; % true if compatible, fault if not ; IF (NOT ary_hasFaults resFltL) THEN ary_idxPL := cart [ary] idxA ; resFltL := optrPhr EACHRIGHT apply ary_idxPL ; ENDIF ; resFltL } +.....+ After this change, and changed to : ELSEIF (= 1 (gage shape idxA)) THEN slc := string first idxA ; % assume list of 1!! ; ...run another test qnial> loaddefs link d_Qndfs 'types.ndf' qnial> lq_arrays qnial> loaddefs link d_Qtest 'arrays/arrays- testOptrs.ndf' qnial> tstOptr "ary_chk_idxA_to_slc_testSimple o ary_chk_idxA_to_slc_testSimple 2 19 24 >> oops, much worse now!?!?!? was up to 8 correct But many are just a reflection of idxA structures, which make more sense now : +--+------------+-----------------------+-------------------------------------------------------------------+ | o|lst01_idxL |[4] |+---+ | | | | ||[4]| | | | | |+---+ | +--+------------+-----------------------+-------------------------------------------------------------------+ | o|lst02_idxL |+---+---+ |+---+---+ | | | ||[4]|[5]| ||[4]|[5]| | | | |+---+---+ |+---+---+ | +--+------------+-----------------------+-------------------------------------------------------------------+ +-----+ olde code ary_idx_getAllSlc IS OP ary idx { LOCAL aryShapeL aryVal i idxBase idxShape resFltL ; resFltL := idx_compatible_ary idx ary ; IF flag_break THEN BREAK ; ENDIF ; IF resFltL THEN resFltL := null ; aryVal := valence ary ; IF (aryVal = 0) THEN resFltL := [[idx]] ; ELSE idxBase := aryVal reshape [null] ; idxShape := gage shape idx ; IF (= aryVal idxShape) THEN resFltL := [EACH solitary idx] ; ELSE FOR i WITH (tell (aryVal - idxShape + 1)) DO iL := i + (tell idxShape) ; resFltL := link resFltL [placeall (idx iL) idxBase] ; ENDFOR ; ENDIF ; ENDIF ; ENDIF ; resFltL } # loaddefs link d_Qndfs 'types.ndf' IF flag_debug THEN write 'loading itm_chk_ary_apply_optrPhr' ; ENDIF ; #] itm_chk_ary_apply_optrPhr IS OP itm ary optrPhr - checks args with argOrder (itm ary) # 24Apr2022 initial itm_chk_ary_apply_optrPhr IS OP itm ary optrPhr { LOCAL resFltL ; resFltL := itm_compatible_ary itm ary ; % true if compatible, fault if not ; IF resFltL THEN resFltL := apply optrPhr (itm ary) ; ENDIF ; resFltL } # tests : qnial> a := ary_idx_getAllSlc (1 3) 0 +-+ |0| +-+ +---+ |+-+| ||0|| |+-+| +---+ qnial> a := ary_idx_getAllSlc 'the bigg fat cow' [4] +---+ |+-+| ||4|| |+-+| +---+ qnial> ary_idx_getAllSlc (4 5 reshape (tell 30)) (2 3) +-----+ |+-+-+| ||2|3|| |+-+-+| +-----+ qnial> ary_idx_getAllSlc (2 4 5 3 2 reshape (tell 300)) (2 3) +--------+--------+--------+--------+ |+-+-++++|++-+-+++|+++-+-++|++++-+-+| ||2|3|||||||2|3|||||||2|3|||||||2|3|| |+-+-++++|++-+-+++|+++-+-++|++++-+-+| +--------+--------+--------+--------+ qnial> ary_idx_getAllSlc (2 4 5 3 2 reshape (tell 300)) (2 3 reshape (tell 10)) ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses ?addresses >> Wrong - must return fault! idxL must be an atm or list (valence 1) # 03May2022 olde code ELSE resFltL := fault '?aigs1' ; # 03May2022 tests ary := (4 5 reshape (tell 30)) idxA := cart ((1 1) EACHBOTH + (EACH tell 2 3)) qnial> ary_idxA_to_slc ary idxA qnial> idxA|[1,] +---+---+---+ |2 1|2 2|2 3| +---+---+---+ qnial> idxA|[1,1 2] +---+---+ |2 2|2 3| +---+---+ qnial> idxA|(1 [1, 2]) +---+---+ |2 2|2 3| +---+---+ # the use of commas is undesirable in optrs (execute a string) qnial> idxA|(1 [1 2]) ?slice qnial> idxA|(1 (1 2)) +---+---+ |2 2|2 3| +---+---+ # a key problem is the nulls qnial> idxA|(null (1 2)) ...null use 0 instead of null qnial> idxA|(0 (1 2)) +---+---+ |1 2|1 3| +---+---+ qnial> idxA|[[null] [1 2]] ?slice qnial> idxA|[null [1 2]] ?slice qnial> idxA|(null (1 2)) ...null qnial> idxA|[null, [1, 2]] ...null qnial> idxA|[, [1, 2]] +---+---+ |1 2|1 3| +---+---+ |2 2|2 3| +---+---+ perhaps I HAVE TO use commas in strings? 04May2022 Redundant and confusiong - will have to fix much code to other form # loaddefs link d_Qndfs 'types.ndf' IF flag_debug THEN write 'loading idx_chk_ary_apply_optrPhr' ; ENDIF ; #] idx_chk_ary_apply_optrPhr IS OP idx ary optrPhr - checks args with argOrder (idx ary) # 24Apr2022 initial idx_chk_ary_apply_optrPhr IS OP idx ary optrPhr { LOCAL resFltL ; resFltL := idx_compatible_ary idx ary ; % true if compatible, fault if not ; IF resFltL THEN resFltL := apply optrPhr (idx ary) ; ENDIF ; resFltL } # 04May2022 olde code ary_chk_idxA_apply_optrPhr IS OP ary idxA optrPhr { LOCAL resFltL ; resFltL := idxA EACHLEFT idx_compatible_ary ary ; % true if compatible, fault if not ; IF (ary_hasFaults resFltL) THEN write 'resFltL = ' resFltL ; % resFltL := fault '?aciao1' ; % for now just one fault (could have big [ary, idA]s) ; ELSE resFltL := apply optrPhr (ary idxA) ; ENDIF ; resFltL } # fault codes : #? ary_chk_idxA_apply_optrPhr '?aciao1' only one fault msg is used, see idx_compatible_ary for under-reasons # 03May2022 tests, see also ary_idxA_to_slc arrays.ndf ary := (4 5 reshape (tell 30)) idxA := cart ((1 1) EACHBOTH + (EACH tell 2 3)) qnial> ary_chk_idxA_apply_optrPhr ary idxA "ary_idxA_to_slc [ 1 2, 1 2 3] # "lst01_idxAtm '[4]' 'should be OK, note that the result is a listL (not obvious from picture output)' qnial> ary_chk_idxA_apply_optrPhr 'the bigg fat cow' 4 "ary_idxA_to_slc [4] # "lst01_idxL '[ 4]' 'should work OK, note that the result is a listL (not obvious from picture output)' qnial> ary_chk_idxA_apply_optrPhr (tell 10) [4] "ary_idxA_to_slc [ ?argument to string must be an atom or string ] >> string optr is in ary_idxA_to_slc, but not in idx_compatible_ary, # 03May2022 tests ary_slc_to_idxA ary := (4 5 reshape (tell 30)) qnial> ary_slc_to_idxA ary ([3] [4] [] [5] [] [6]) # qnial> slc := [3] [4] [] [5] [] [6] +-+-++-++-+ |3|4||5||6| +-+-++-++-+ 08********08 #] 27Apr2022 ary_slice_groupTest ary_idx_getAllAxes_slcA returns wrong format : text |[?address] rather than integerLL 28Apr2022 HeapPermute Heap's algorithm $ find "$d_Qndfs" -maxdepth 4 -type f -name "*.ndf" | grep --invert-match "z_Old\|z_Archive" | tr \\n \\0 | xargs -0 -IFILE grep --with-filename --line-number "permut" "FILE" | grep "IS OP" $ find "$d_Qndfs" -maxdepth 4 -type f -name "*.ndf" | grep --invert-match "z_Old\|z_Archive" | tr \\n \\0 | xargs -0 -IFILE grep --with-filename --line-number "factorial" "FILE" | grep "IS OP" +-----+ # 28Apr2022 olde code # my fumble fuse? does permutations - no good, too regular? < EACH valence sub lst must have all subSubs in result subPermLL := lst ; FOR subAxis WITH (tell valence sub) DO FOR subPerm := link subPerm sub@subAxis HeapPermute_lst lst { % if size becomes 1 then prints the obtained permutation ; IF (size = 1) THEN write a ; ENDIF ; for (int i = 0; i < size; i++) { heapPermutation(a, size - 1, n); % if size is odd, swap 0th i.e (first) and (size-1)th i.e (last) element ; if (size % 2 == 1) swap(a[0], a[size - 1]); % If size is even, swap ith and (size-1)th i.e (last) element ; else swap(a[i], a[size - 1]); } } 29Apr2022 old code # 28Apr2022 olde code ary_idx_getAllAxes_slcA IS OP ary idx { LOCAL ary aryShapeL aryVal i resFltL slcStrLL ; resFltL := itm_compatible_ary idx ary ; IF resFltL THEN % for each aryTop dimension, generate idxL, note: compatible means (aryVal = gage shape itmidx) ; aryVal := valence ary ; slcStrLL := aryVal reshape [aryVal reshape ','] ; FOR i WITH (tell aryVal) DO slcStrLL@@(i i) := link (string idx@i) ',' ; ENDFOR ; slcStrLL := EACH front EACH link slcStrLL ; resFltL := EACH link ( ('|[' EACHRIGHT link slcStrLL) EACHLEFT link ']') ; ENDIF ; resFltL } # 29Apr2022 olde code ary_idx_getAllAxes_slcA IS OP ary idx { LOCAL ary aryShapeL aryVal i resFltL slcStrLL ; resFltL := itm_compatible_ary idx ary ; IF flag_break THEN BREAK ; ENDIF ; IF resFltL THEN n_axsFree := (valence ary) - (gage shape idx) ; IF (n_axsFree > 0) THEN axsCombos := cart link idx (n_axsFree reshape [null]) ; ENDIF ; aryVal := valence ary ; FOR i WITH (tell aryVal) DO slcStrLL@@(i i) := link (string idx@i) ',' ; ENDFOR ; slcStrLL := EACH front EACH link slcStrLL ; resFltL := EACH link ( ('|[' EACHRIGHT link slcStrLL) EACHLEFT link ']') ; ENDIF ; resFltL } 08********08 #] 26Apr2022 ary_restruct_groupTest, ary_slice_groupTest +-----+ aryA_join_horizontal_testSpecial ary_restruct_groupTest - fixed, now works 100% +-----+ ary_slice_groupTest sub_chk_idx_to_slc_testSimple - works! +-----+ olde code IF flag_debug THEN write 'loading ary_getAllSlcPermutations_testStd' ; ENDIF ; # ary_getAllSlcPermutations_testStd IS OP ary - was this for [reverse list, transposed] searches? # 14Apr2022 come back some time in the future # tstOptr "ary_getAllSlcPermutations_testStd ary_getAllSlcPermutations_testStd := "tstStandard "d_arrayTests "ary1Arg_datStd ( "null01 null 'not defined for null = ary' "atm01 (fault '?sca2') 'not defined for isAtm ary' "lst01 (fault '?sca3') 'OK - simple list' "lst02 (tell 4) 'OK - simple list' "lstL01 (tell 4) 'OK - simple listL' "ary01 (reshape 4 5) 'OK - simple ary' "ary02 (reshape 2 2) 'OK - nested ary' "ary03 (reshape 2 2 2) 'OK - nested ary' "ary04 (reshape 2 2) 'OK - nested ary' "ary05 (reshape 3 2) 'OK - simple ary of str' ) ; 08********08 #] 25Apr2022 [create, test] idx [optr,tst]s, fix [itm, sub]*[optr,tst]s Created : idx_compatible_ary IS OP idx ary - ensure [idx, ary] compatible, returns resFltL = OR [l, faultL] idx refers to one point only at topLevel of ary idx_chkFor_ary_apply_optrPhr IS OP itm ary optrPhr - res ipsa loquitor idx_chkFor_ary_get_itm IS OP idx ary - res ipsa loquitor idx_chkFor_ary_get_itm_testSimple := - tests that [ix, ary] "fit", then applies optr Also fixed up several other [test, optr]s : itm_compatible_ary IS OP itm ary - ensure [itm, ary] compatible, returns resFltL = [l, faultL] itm_chkFor_ary_apply_optrPhr IS OP itm ary optrPhr - res ipsa loquitor itm_posnAInTopChkinp_ary IS OP itm ary - res ipsa loquitor itm_posnAInTopChkinp_ary_testStd := - returns LIST of Substr positions in Str, or an error sub_posnA1stItmInTopChkinp_ary IS OP itm ary - res ipsa loquitor sub_posnA1stItmInTopChkinp_ary_testStd := - results and comments sub_posnAAllItmInTopChkinp_ary IS OP sub ary - res ipsa loquitor sub_posnAAllItmInTopChkinp_ary_testStd := - returns list of Substr positions in Str, or an error ary_posn_groupTest >> Working good! Don't work, fix in a few weeks or so : subL_posnAAllItmInTopChkinp_ary_testSimple subL_posnAAllItmInTopChkinp_ary_testStd 08********08 #] 22Apr2022 tests that failed : atm_lst01, 2], atm_ary01, lst_lst10, ?spAllia4 +-----+ from 21Apr2022 tstOptr "sub_posnAAllItmInTop_ary_testStd tests that failed : atm_lst01, 2], atm_ary01, lst_lst10, ?spAllia4 all isAtm sub tests failed in tstOptr [sub_compatible_ary, sub_posnAAllItmInTop_ary_testStd] most isLst ary tests worked - lst_lst10 '?? ?sp1ia2 returned, should be ?sca5 - coding error, (OR (> EACH (gage shape) subr ary)) ' lst_ary02 'should be OK as gives ?spAllia4, answer looks good but fails (1)' perhaps : results from isAtm arys are themselves (1 reshape fault)? results from isArySimple arys are themselves (1 1 reshape fault)? 23Apr2022 sub_posnAAllItmInTop_ary -> convert atm to shaped sub_compatible_ary change : +.....+ ELSEIF (OR (> EACHBOTH (gage shape) sub ary)) THEN resFltL := link resFltL (fault '?sca5') ; +.....+ To : +.....+ ELSEIF (OR (EACHBOTH > EACH (gage shape) sub ary)) THEN resFltL := link resFltL (fault '?sca5') ; +.....+ >> OK, now sub_posnA1stItmInTopChkinp_ary_testStd test lst_lst10 is correct, and all others 08********08 #] 21Apr2022 fix tstOptrs Check : looks OK? - 'QNial setup header.ndf' (changed aryOptrSymbol pre-defs) looks OK? - 'QNial test optrs.ndf' looks OK? - 'arrays/arrays- testOptrs.ndf' (tstSimple formats OK) flag_break failed aryTest : ary_getAllSlcL -> CHANGED to ary_indx_getAllSlc : old symbol not used in arrays.ndf itm_posnAInTop_ary_testStd, with flag_break in sub_posnA1stItmInTop_ary -->[stepv] resume o itm_posnAInTop_ary_testStd 0 27 27 >> but optr looks OK, maybe tstStandard? tstOptr "ary_getAllAxisIndxContain_itm_testStd ?.. Calcl := Optrphr EACHRIGHT apply ( rows transpose mix Datcols ) -->[nextv] ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation -->[nextv] optrPhr ?valence error in take -->[nextv] testOptrStr ary_getAllAxisIndxContain_itm_testStdfailure of isLst ary!! >> Ah Hah! valence fault, which I did not check previously, >> faulure of isLst ary in sub_posnA1stItmInTop_ary? I had removed that from sub_posnA1stItmInTop_ary optrPhr := phrase (('_test' sub_posnA1stItmInTop_ary testOptrStr) take testOptrStr) ; -->[nextv] '_test' sub_posnA1stItmInTop_ary 'ary_getAllAxisIndxContain_itm_testStd' 3 25 29 >> OK, so it is not isLst ary problem +-----+ optrs don't exist in 'arrays/arrays- testOptrs.ndf' : ary_getAllAxisIndxContain_itm -> to ary_itm_getAllSlc ary_getAllAxisIndxContain_sub -> to ary_sub_getAllSlc changed ary_sub_getAllSlc to _getAllAxisSlc changed indx to idx (this will be a lot of work!! - ary tstOptrs too) 200+ in arrays.ndf, change Axis to Axs >> oops, needed to refresh TableOfContents for arrays.ndf arrays.ndf changed : aryL_commonKeyCullSort_aryCombinedOut -> aryL_keyLIdx_cullSort lstL_sortupCullOn1st -> aryA_sortupOn1st 'arrays/arrays- testOptrs.ndf' changed : aryL_commonKeyCullSort_aryCombinedOut -> aryL_keyLIdx_cullSort strings.ndf changed : [I,i]ndx to [I,i]dx arrays.ndf changed : hold -> get replace -> put [keep, insert] -> can't think of short mnemonic, says the same (not so important for verbs, mostly [noun, adjective]s) 'arrays/arrays- testOptrs.ndf' changed : hold -> get (just commentary, didn't change) replace -> put [strings.ndf, file_ops.ndf] - changed [hold, replace] +-----+ '?valence error in take' - back to this problem : This might be due to the reshaping of sub to subr, to correspond to (valence ary) make ure that take uses sub instead of subr? focus on sub_posnA1stItmInTop_ary fonn tstOptr "sub_posnA1stItmInTop_ary_testStd -->[nextv] optrPhr ?valence error in take >> here is the problem - WHY? '_test' sub_posnA1stItmInTop_ary testOptrStr -> need all '_test' indxs for last occurence,t idxL for all `_ -> but there many `_ -->[nextv] '_test' sub_posnAAllItmInTop_ary testOptrStr +---------+--------------+--------------+ |3 4 5 6 7|20 21 22 23 24|24 25 26 27 28| +---------+--------------+--------------+ >> giant oops - only ONE idxL works! tstStandard change : +.....+ optrPhr := phrase (('_test' sub_posnA1stItmInTop_ary testOptrStr) take testOptrStr) ; +.....+ To : +.....+ optrPhr := phrase ((tell first ('_test' sub_posnAAllItmInTop_ary testOptrStr)) choose testOptrStr) ; +.....+ +-----+ olde code # try code without special section for lists : IF (isLst ary) THEN resFltL := o ; fnd1stSubItmIndxAL := first subr findall ary ; IF (= null fnd1stSubItmIndxAL) THEN resFltL := fault '?sp1ia4' ; ELSE subFindL := tally subr EACHRIGHT take (fnd1stSubItmIndxAL EACHLEFT drop ary) ; resFltL := (subr EACHRIGHT = subFindL) sublist fnd1stSubItmIndxAL ; IF (isfault resFltL) THEN resFltL := link resFltL (fault '?sp1ia2') ; ENDIF ; ENDIF ; ELSE fnd1stSubItmIndxAL := first subr findall ary ; IF (isFault fnd1stSubItmIndxAL) THEN resFltL := fault '?sp1ia1' ; ENDIF ; ENDIF ; # olde code : % this was already done by sub_posnA1stItmInTop_ary, should avoid this second calc somehow ; ?? need new optr!! subr := sub_compatible_ary sub ary ; % ??? wrong - Y Axs of shape 1 will be a problem!!!? ; 08********08 #] 20Apr2022 sub_posnA1stItmInTop_ary works beautifully - but can I get rid of the list-specific coding? Unbelieable!! seems to work fine on the 3 tests I did. This saves redundant code, simfies, and attains general ary-optr target, it seems Try clusterTest "arrays_testCluster >> CRAP! - '?not an operation' faults, problems with testOptrs yet again (this is tiring!) most aryOptrs shouldn't have been affected? # 20Apr2022 tests # qnial> sub_idx_to_slc (4 5 6) 1 # o-----+ # |1 2 3| # +-----+ # qnial> sub_idx_to_slc (4 5 6) [1] # +-----+ # |1 2 3| # +-----+ # qnial> sub_idx_to_slc (3 4 reshape (tell 20)) (0 4) # +-----+-------+ # |0 1 2|4 5 6 7| # +-----+-------+ # qnial> sub_idx_to_slc (3 4 reshape (tell 20)) (1 1 reshape 0 4) # +-----+-------+ # |0 1 2|0 1 2 3| # +-----+-------+ # qnial> sub_idx_to_slc (2 3 4 reshape (tell 30)) (0 1 2) # +---+-----+-------+ # |0 1|1 2 3|2 3 4 5| # +---+-----+-------+ 08********08 #] 19Apr2022 fix optrs [indx_compatible_ary, ary_indx_getAllSlc, ary_itm_getSlcA, itm_posnAInTop_ary, #] sub_posnA1stItmInTop_ary] +-----+ indx_compatible_ary : new test : indx_compatible_ary_testSimple Again, all tests return : ?not an operation >> I've screwed up all tests? ?.. Calcl := Optrphr EACHRIGHT apply ( rows transpose mix Datcols ) -->[nextv] ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation ?not an operation -->[nextv] optrPhr ?valence error in take -->[nextv] testOptrStr itm_posnAInTop_ary_testStd -->[nextv] '_test' sub_posnA1stItmInTop_ary testOptrStr >> null -->[nextv] resume o itm_posnAInTop_ary_testStd 0 0 27 I need to fix sub_posnA1stItmInTop_ary for testing otrs BUT indx_compatible_ary works fine: qnial> indx_compatible_ary (1 2) (2 3 reshape 10) l qnial> indx_compatible_ary `a 'this is a test' ?ixca2 +-----+ sub_compatible_ary : qnial> sub_compatible_ary 4 (4 5 reshape (tell 30)) >> null qnial> sub_compatible_ary (5 6 7 8) (4 5 reshape (tell 30)) >> null >> so it's not working!! optr change, errant symbol from past : +.....+ ELSEIF (OR (> EACHBOTH (gage shape) subr ary)) +.....+ To : +.....+ ELSEIF (OR (> EACHBOTH (gage shape) sub ary)) +.....+ also rearranged IF a bit now works fine +-----+ sub_posnA1stItmInTop_ary - complete optr revamp (again!) post-slice intro 19Apr2022 - big changes 20Apr2022 had to fix faults.ndf ary_hasFaults, but others as well,ild tstStds sub_posnA1stItmInTop_ary (1 1 reshape 4 ) (5 6 reshape (tell 30)) -->[nextv] tellShapeSub +---+ |0 0| +---+ ?.. Slicer := Indx + Tellshapesub -->[nextv] +---+ |0 4| +---+ ?.. Subt := Ary | [ Slicer ] -->[nextv] ?slice sub := (2 3 2) gage shape sub tell (gage shape sub) sub := ((2 3 2) >> 20Apr2022 now sub_posnA1stItmInTop_ary works beutifully +-----+ olde code # olde code ELSE slcL := (aryVal reshape [link (aryVal reshape ',')]) ; FOR i WITH (tell aryVal) DO slcStrLL@@(i i) := EACH link (link ',' (string indx@i)) ; ENDFOR ; slcStrLL := EACH rest (EACH link slcStrLL) ; resFltL := EACH link ( ('|[' EACHRIGHT link slcStrLL) EACHLEFT link ']' ) ; ENDIF ; IF resFltL THEN % for each aryTop dimension, generate indxL, note: compatible means (aryVal = gage shape itmIndx) ; aryVal := valence ary ; IF (= 1 aryVal) THEN resFltL := link '|[' (string indx) ']' ; ELSE slcStrLL := aryVal reshape [aryVal reshape ','] ; FOR i WITH (tell aryVal) DO slcStrLL@@(i i) := link (string indx@i) ',' ; ENDFOR ; slcStrLL := EACH front EACH link slcStrLL ; resFltL := EACH link ( ('|[' EACHRIGHT link slcStrLL) EACHLEFT link ']') ; ENDIF ; ENDIF ; resFltL # olde code : move this to subsequent step - keep sub_compatible_ary simple! #? sub_compatible_ary ?sca5 lists, (OR (> EACH (gage shape) subr ary)) % default assumption is to take sub at the lowest dimensions (axis) of ary, and expand ; % better approach : the calling optr should reshape sub, avoiding this restructure f sub! ; IF (valSub <= valAry) THEN subr := (link ((valAry - valSub) reshape 1) (gage shape sub)) reshape sub ; ELSE subr := sub ; ENDIF ; IF (0 = valAry) THEN null ; % 14Apr2022 probably redundant ; ELSEIF (1 = valAry) THEN IF (OR (> EACH (gage shape) subr ary)) THEN resFltL := link resFltL (fault '?sca5') ; ENDIF ; ELSE IF (OR (> EACHBOTH (gage shape) subr ary)) THEN resFltL := link resFltL (fault '?sca6') ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; % ; IF (= null resFltL) THEN resFltL := subr ; ENDIF ; # olde code - this is nuts - just findall, it's simple! ELSE % first check for sub1stItm in aryTop (exhaustive, inefficient) ; sub1stItm := first sub ; indxASub1st := (sub1stItm EACHRIGHT = ary) findall (ary_indxATop ary) ; IF (= null indxASub1st) THEN resFltL := link resFltL (fault '?sp1ia3') ; ENDIF ; % ; IF (NOT ary_hasFaults resFltL) THEN % ??? is this right? ; fitIndx1stSubItem := null ; maxIndx1stSubItem := (shape ary) - (shape sub) ; FOR indx WITH indxASub1st DO IF (AND (indx EACHBOTH <= maxIndx1stSubItem)) THEN fitIndx1stsubItem := append fitIndx1stSubItem indx ; ENDIF ; ENDFOR ; % ; IF (= null fitIndx1stSubItem) THEN resFltL := link resFltL (fault '?sp1ia4') ; ELSE % find matches ; matchIndx1stsubItemL := null ; FOR indx WITH fitIndx1stSubItem DO slicer := indx + (EACH tell (shape sub)) ; IF (sub = ary|slicer) THEN matchIndx1stSubItemL := append resFltL indx ; ENDIF ; ENDFOR ; IF (= null matchIndx1stSubItemL) THEN resFltL := link resFltL (fault '?sp1ia5') ; ELSE resFltL := matchIndx1stSubItemL ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; % ; resFltL } # 20Apr2022 tests ary_isAllFaults IS OP ary { AND EACH isfault ary_to_atmL ary } -->[nextv] ary_isAllFaults olo o -->[nextv] LEAF isfault olo ooo -->[nextv] AND AND olo o -->[nextv] ary_isAllFaults o (fault '?tstFlt') o o -->[nextv] ary_isAllFaults (fault '?tstFlt') (fault '?tstFlt') (fault '?tstFlt') l -->[nextv] ary_isAllFaults [(fault '?tstFlt') (fault '?tstFlt')] (fault '?tstFlt') l # 20Apr2022 tests ary_hasFaults IS OP ary { OR EACH isfault ary_to_atmL ary } -->[nextv] ary_hasFaults olo o -->[nextv] LEAF isfault olo ooo -->[nextv] OR OR olo l -->[nextv] ary_hasFaults o (fault '?tstFlt') o l -->[nextv] ary_hasFaults [o (fault '?tstFlt')] o l -->[nextv] ary_hasFaults [(fault '?tstFlt') (fault '?tstFlt')] (fault '?tstFlt') l # 20Apr2022 tests ary_hasFaults IS OP ary { OR OR (LEAF isfault ary) } -->[nextv] ary_hasFaults olo o -->[nextv] LEAF isfault olo ooo -->[nextv] OR OR olo l -->[nextv] ary_hasFaults o (fault '?tstFlt') o l -->[nextv] ary_hasFaults [o (fault '?tstFlt')] o ol # 13Feb2022 tests qnial> ary_countFaults (fault '?1') (fault '?2') (fault '?3') (fault '?4') 4 qnial> ary_countFaults l o l (fault '?1') l l (fault '?2') o o (fault '?3') ooo (fault '?4') 4 qnial> ary_countFaults (fault '?1') (l o l (l l (o o (l o (fault '?3'))))) (fault '?2') 3 qnial> ary_countFaults (fault '?1') (2 3 reshape l o l (l l (o o (l o (fault '?3')))) (l `q (fault '?4')) (l `q (fault '?5'))) (fault '?2') 5 # 20Ap2022 earlier version ary_hasFaults IS OP ary { OR OR (LEAF isfault ary) } # 20A2022 earlier version : ary_isAllFaults IS OP ary { AND AND (LEAF isfault ary) } # -->[nextv] 1 findall (3 reshape tell 4) 1 -->[nextv] 1 findall (3 reshape (tell 4)) 1 -->[nextv] 1 findall (3 4 reshape 1) +---+---+---+---+---+---+---+---+---+---+---+---+ |0 0|0 1|0 2|0 3|1 0|1 1|1 2|1 3|2 0|2 1|2 2|2 3| +---+---+---+---+---+---+---+---+---+---+---+---+ -->[nextv] 66 findall (3 4 reshape 4) -->[nextv] % fnd1stSubItmIndxAL fndMaxIndxL fitMaxIndxL fit1stSubItmIndxAL ; % EACH (OR list) (((gage shape ary) EACHRIGHT - fndMaxIndxL) EACHLEFT >= 0) ; % EACH OR EACH OR list (((gage shape ary) EACHRIGHT - fndMaxIndxL) EACHLEFT >= 0) ; % [0 4] sum (2 3) ; % ((0 4) (1 3) (4 1)) EACHLEFT sum (2 3) ; % fndMaxIndxL := fnd1stSubItmIndxAL EACHLEFT sum (tell (gage shape sub)) ; % fitMaxIndxL := first (EACH (OR list) ( ((gage shape ary) EACHRIGHT - fndMaxIndxL) EACHLEFT >= 0 ) ) ; % fndMaxIndxL := fnd1stSubItmIndxAL EACHLEFT EACHBOTH sum (tell (gage shape subr)) ; % fndMaxIndxL := fnd1stSubItmIndxAL sum (EACH tell (gage shape subr)) ; # 20Apr2022 olde code % slicer := cart indxTellL ; % IF (= 1 (gage shape slicer)) THEN slicer := first slicer ELSE slicer ENDIF ; # 20Apr2022 olde code IF (NOT isLst sub) THEN subr := [sub] ; ENDIF ; % ELSE fnd1stSubItmIndxAL := first fnd1stSubItmIndxAL ; % ELSEIF (OR (isAtm fnd1stSubItmIndxAL) (= 1 (gage shape fnd1stSubItmIndxAL))) THEN fnd1stSubItmIndxAL := [fnd1stSubItmIndxAL] ; % MUST sub must have same valence as ary! - otherwise multiple possibilities (except lists) ; % 20Apr2022 this should be moved into sub_compatible_ary ; resFltL := l ; IF (~= EACH valence sub ary) THEN resFltL := fault '?sp1ia0' ; # tests to generate errors : # qnial> sub_posnA1stItmInTop_ary (tell 30) (4 5 reshape (tell 30)) # ?sp1ia4 >> this is wrong! # qnial> sub_posnA1stItmInTop_ary (5 6 7 8) (4 5 reshape (tell 30)) # ?sp1ia4 # qnial> sub_posnA1stItmInTop_ary (2 3) (4 5 reshape (tell 30)) # 0 2 >> 20Apr2022 now sub_posnA1stItmInTop_ary works beutifully 08********08 #] 17Apr2022 fix ary_indx_getAllSlc +-----+ olde code # olde code ary_indx_getAllSlc IS OP ary indx { LOCAL ary aryShapeL aryVal i resFltL slcStrLL ; resFltL := indx_compatible_ary indx ary ; IF flag_break THEN BREAK ; ENDIF ; IF resFltL THEN % for each aryTop dimension, generate indxL, note: compatible means (aryVal = gage shape itmIndx) ; aryShapeL := gage shape ary ; aryVal := valence ary ; slcStrLL := (aryVal reshape [link (aryVal reshape ',')]) ; FOR i WITH (tell aryVal) DO slcStrLL@@(i i) := EACH link (link ',' (string indx@i)) ; ENDFOR ; slcStrLL := EACH rest (EACH link slcStrLL) ; resFltL := EACH link ( ((link (string ary) '|[') EACHRIGHT link slcStrLL) EACHLEFT link ']' ) ; ENDIF ; resFltL } # olde code confusion - I don't need this for sub_posnA1stItmInTop_ary, but perhaps later # I think that the slice optrs will handle things well? % default assumption is to take sub at the lowest dimensions (axis) of ary, and expand ; % better approach : the calling optr should reshape sub, avoiding this restructure f sub! ; IF (valSub <= valAry) THEN subr := (link ((valAry - valSub) reshape 1) (gage shape sub)) reshape sub ; ELSE subr := sub ; ENDIF ; 08********08 #] 15Apr2022 AWESOME!! : bash "$d_bin"'linux.sh' - key cmds cart [options, usage], txtEd for full view #] 14Apr2022 create tests slc - INDEX of "full-and-all-axis" split of an array $ find "$d_Qndfs" -maxdepth 0 -type f -name "*.ndf" | grep --invert-match "z_Old" | grep --invert-match "z_Archive" | tr \\n \\0 | xargs -0 -IFILE grep -w --with-filename --line-number 'tostring_sep' "FILE" >> can't find $ find "$d_Qndfs" -maxdepth 3 -type f -name "*.ndf" | grep --invert-match "z_Old" | grep --invert-match "z_Archive" | tr \\n \\0 | xargs -0 -IFILE grep -wi --with-filename --line-number 'txt_rows_to_array' "FILE" >> OK, needed -i option, more depth! $ find "$d_Qndfs" -maxdepth 3 -type f -name "*.ndf" | grep --invert-match "z_Old" | grep --invert-match "z_Archive" | tr \\n \\0 | xargs -0 -IFILE grep -wi --with-filename --line-number 'tostring_sep' "FILE" | grep ' IS OP ' >> still nothing, which is WRONG! /media/bill/Dell2/Website - raw/Qnial/MY_NDFS/Interpolation.ndf:56:tostring_sep IS OP A S { front link (EACH string (list A) EACHLEFT link S) } >> OK, include this in 'strings.ndf' until new version tostring_sep IS OP A S { front link (EACH string (list A) EACHLEFT link S) } +-----+ olde code # loaddefs link d_Qtest 'arrays/arrays- testOptrs.ndf' IF flag_debug THEN write 'loading itm_posn1stInTop_ary_testStd' ; ENDIF ; #] itm_posn1stInTop_ary_testStd := - posnL of 1st chr of Substr in Str, or null # 05Nov2021 cut to dataBone # tstOptr "itm_posn1stInTop_ary_testStd itm_posn1stInTop_ary_testStd := "tstStandard "d_arrayTests "aryTstDat_tbl ( "null_null01 (EACH fault '?ica1' '?ica2') 'not defined for null = [itm, ary]' "atm_null01 [fault '?ica2'] 'not defined for null = itm' "lst_null01 [fault '?ica2'] 'not defined for null = itm' "null_atm01 (EACH fault '?ica1' '?ica3') 'not defined for [null = itm, isAtm ary]' "atm_atm01 [fault '?ica3'] 'not defined for isAtm ary' "atm_atm02 [fault '?ica3'] 'not defined for isAtm ary' "null_lst01 [fault '?ica1'] 'not defined for null = itm' "atm_lst01 3 'OK - should work' "atm_lst02 4 'OK - should work' "lst_lst01 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst02 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst03 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst04 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst05 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst06 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst07 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst08 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst09 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lst10 [fault '?ip1a1'] 'not an itm, its a sub' "lst_lstL01 [fault '?ip1a1'] 'not an itm, its a sub' "lstL_lst01 [fault '?ip1a1'] 'not an itm, its a sub' "lstL_lst02 [fault '?ip1a1'] 'lst not an [itm, sub]' "lstL_lstL01 [fault '?ip1a1'] 'lst not an [itm, sub]' "atm_ary01 (0 4) 'OK - should work' "lst_ary01 [fault '?ip1a1'] 'itm (ary) not an [itm, sub]' "lst_ary02 [fault '?ip1a1'] 'itm (ary) not an [itm, sub]' "ary_ary01 [fault '?ip1a1'] 'itm (ary) not an [itm, sub]' ) ; # 14Apr2022 not terribly useful? just use ary EACHRIGHT itm_posnAInTop_ary itmA IF flag_debug THEN write 'loading itm_posnAInTop_ary' ; ENDIF ; #] itm_posnAInTop_ary IS OP itm ary - posnA of itm in TOP level of ary, or null (not useful?) #] or null. itm MUST be an "element" of lst, eg (0 1) in ((0 1) 2 3 4 5), not in (0 1 2 3 4 5) # 04Nov2021 initial from strings.ndf (~identical) # 07Nov2021 danger of "distancing" programmer from simple expressions that SHOULD be natural! # 09Nov2021 ary version # 11Apr2022 renamed faultMsg, added corrections itm_posnAInTop_ary IS OP itm ary { LOCAL resFltL ; resFltL := itm_compatible_ary itm ary ; IF resFltL THEN resFltL := itm findall ary ; IF (= null resFltL) THEN resFltL := fault '?ipaa1' ; ENDIF ; ENDIF ; resFltL } # fault codes : #? itm_posnAInTop_ary '?ipaa1' item is not in ary # 14Apr2022 come back some time in the future IF flag_debug THEN write 'loading ary_getAllSlcPermutations' ; ENDIF ; #] ary_getAllSlcPermutations IS OP ary - 14Apr2022 was this for [reverse list, transposed] searches? #] ??? where am I going with this? # 17Nov2021 initial # at top level, all slices must have valence 1 less than ary, otherwise could cut out an "empty space" # 17Nov2021 would it be cheaper to simply test if each slc is a slice? ary_getAllSlcPermutations IS OP ary { resFltL := sub_compatible_ary `a ary ; % screens out [ary=[null, atm]], itm = `a is a dummy arg ; IF resFltL THEN allIndxs := ary_getAllSlcL ary ; % permutations of each axis' shape ; allAxisTell := EACH tell (gage shape ary) ; allSlices := 5 ; ENDIF ; } 08********08 #] 13Apr2022 groupTest "ary_restruct_groupTest Oops ed to fix test setups, resultStds atm_restructSameAs_ary_testSimple >> wow! needs new name not just atm but aryInn ary1_replaceAtmsIn_ary2_testSimple aryPL_transStr_isSameStruct - needs work 14Apr2022 quick fix, OK # olde code n_cols := 5 ; n_rows := floor ((gage shape inputs) / n_cols) ; testNumL dat1L dat2L stdResultL commentL := cols (n_rows n_cols reshape inputs) ; % ; eachResultL := optr EACHRIGHT apply (rows transpose mix (dat1L (n_rows reshape ['EACH']) dat2L)) ; twigResultL := optr EACHRIGHT apply (rows transpose mix (dat1L (n_rows reshape ['TWIG']) dat2L)) ; leafResultL := optr EACHRIGHT apply (rows transpose mix (dat1L (n_rows reshape ['LEAF']) dat2L)) ; OKL := stdResultL EACHBOTH = (rows transpose mix eachResultL twigResultL leafResultL) ; test_tbl := aryA_join_vertical (1 8 reshape ('OK' 'test#' 'dat1' 'dat2' 'rEACH' 'rTWIG' 'rLEAF' 'commentL')) (transpose mix (OKL testNumL dat1L dat2L eachResultL twigResultL leafResultL commentL)) ; % ; % Output to screen, for debug only?) ; % write to screen ; % EACH write '' '+-----+' (link '#] ' (string optr) ' test ' timestamp_DDMMMYYYY_HMS) ; % (write test_tbl) ; % (write ' ') ; % ; % write to file ; dir := link d_Qtest 'arrays/z_Archive/' ; plog := link dir timestamp_YYMMDD_HMS ' ' (string optr) ' test.txt' ; aryPicture_writeTo_pout_pthTyp (picture test_tbl) plog "padd ; % ; optr (sum OKL) n_rows ) ; # EACH (gage shape) testNumL dat1L dat2L stdResultL commentL # code-in-waiteing : IF (= null faultL) THEN optrPhr (sum OKL) n_rows ELSE faultL ENDIF 08********08 #] 13Apr2022 sub_posnAAllItmInTop_ary fails with isLst sub sub_posnAAllItmInTop_ary - fails with isLst sub (probably arySimple as well as sub?) sub_posnAAllItmInTop_ary change : +.....+ positionL := first subr findall ary ; +.....+ To : +.....+ positionL := first first subr findall ary ; +.....+ OK - still a problem with : sub_posnAAllItmInTop_ary_testStd | 25| 0| 27| subL_posnAAllItmInTop_ary_testSimple| 5| 0| 14| subL_posnAAllItmInTop_ary_testStd | 0| 0| 27| Olde code : sub_posnA1stItmInTop_ary IS OP sub ary { LOCAL indx positionL resFltL slicer indxA_1stSubItm_in_aryTop matchIndx1stSubItem maxIndx1stSubItem ; % ; subr := null ; resFltL := sub_compatible_ary sub ary ; % screens out [sub=null, ary=[null, atm]] ; % ; IF flag_break THEN BREAK ; ENDIF ; % ignore ary [isNull, isAtm], as posns are undefined in those cases, which return faults ; IF (NOT ary_hasFaults resFltL) THEN subr := resFltL ; resFltL := null ; IF (isLst ary) THEN positionL := first subr findall ary ; IF (isFault positionL) THEN positionL := sub_posnA1stItmInTop_ary subr ary ; ELSE resFltL := (subr EACHRIGHT = (tally subr EACHRIGHT take (positionL EACHLEFT drop ary))) sublist positionL ; IF (isfault resFltL) THEN resFltL := link resFltL (fault '?sp1ia2') ; ENDIF ; ENDIF ; % ; ELSE % first check for subr1stItm in aryTop (exhaustive, inefficient) ; indxA_1stsubrItm_in_aryTop := ((first subr) EACHRIGHT = ary) sublist (ary_indxATop ary) ; IF (isfault indxA_1stsubrItm_in_aryTop) THEN resFltL := link resFltL (fault '?sp1ia3') ; ENDIF ; % ; IF (NOT ary_hasFaults resFltL) THEN fitIndx1stsubrItem := null ; maxIndx1stsubrItem := (shape ary) - (shape subr) ; FOR indx WITH indxA_1stsubrItm_in_aryTop DO IF (AND (indx EACHBOTH <= maxIndx1stsubrItem)) THEN fitIndx1stsubrItem := append fitIndx1stsubrItem indx ; ENDIF ; ENDFOR ; % ; IF (= null fitIndx1stsubrItem) THEN resFltL := link resFltL (fault '?sp1ia4') ; ELSE % find matches ; matchIndx1stsubrItemL := null ; FOR indx WITH fitIndx1stsubrItem DO slicer := indx + (EACH tell (shape subr)) ; IF (subr = ary|slicer) THEN matchIndx1stsubrItemL := append resFltL indx ; ENDIF ; ENDFOR ; IF (= null matchIndx1stsubrItemL) THEN resFltL := link resFltL (fault '?sp1ia5') ; ELSE resFltL := matchIndx1stsubrItemL ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; % ; resFltL } 08********08 #] 12Apr2022 atomA_restructSameAs_ary_test, other ary tests legacy name : atomA_restructSameAs_ary -> atm_restructSameAs_ary qnial> tstOptr "atm_restructSameAs_ary_test increasing call stack to 200 increasing call stack to 300 ... increasing call stack to 5300 Segmentation fault >> oops! missing termination condition, or just too large? optr change : +.....+ ELSE EACH atm_restructSameAs_ary (cart atm [ary]) +.....+ To : +.....+ ELSE atm EACHRIGHT atm_restructSameAs_ary ary +.....+ >> OK, works add errors for nulls, maybe isAtm ary? +-----+ After many revamps : fix : link d_Qtest 'arrays/arrays- testGroupsCluster.ndf' run : groupTest "ary_posn_groupTest >> disaster, back to square one. All calcs = fault '?not an operation' >> at least the tests in the group ran and gave output Try : sub_compatible_ary null null sub_compatible_ary 4 null sub_compatible_ary 'the bigg fat cow' null sub_compatible_ary (4 5) (tell 10) sub_compatible_ary '[#=; backtrack ;=#]' '[#=; backtrack ;=#]Howell - Mega-Life, Mega-Death and the Sun, the rise and f_lstl of civilisations.pdf' >> all work fine! so it's the test optrs themselves qnial> tstOptr "sub_compatible_ary_testStd o ?left argument in take must be integers 0 0 27 -->[nextv] optrPhr ?left argument in take must be integers problem is sub_posnA1stItmInTop_ary tstStandard IS OP tstOptrPhr optrPhr := phrase (('_test' sub_posnA1stItmInTop_ary testOptrStr) take testOptrStr) ; examples : qnial> '_test' sub_posnA1stItmInTop_ary 'sub_compatible_ary_testStd' _test >> hilarious, I'm an idiot minor fixes to itm_posnAInTop_ary qnial> `_ itm_posnAInTop_ary 'sub_compatible_ary_testStd' 3 14 18 >> OK sub_posnA1stItmInTop_ary change : +.....+ IF (= null positionL) THEN resFltL := link resFltL (fault '?sp1ia1') ; +.....+ To : +.....+ IF (isFault positionL) THEN resFltL := link resFltL (fault '?sp1ia1') ; +.....+ qnial> itm_posn1stInTop_ary ` 'the bigg fat cow' 3 >> OK, this is still working 13:14 take a break, fix eavestrough, ir in Nissan tires, clean bathroom, etc 14:44 back, pooped after almost no work! qnial> tstOptr "itm_posn1stInTop_ary_testStd o itm_posn1stInTop_ary 3 0 27 >> botched - need to change '?ip1a[1-3]' to ?ica[...], '?ip1a4' to '?ip1a1' >> same for [sub_compatible_ary_testStd, sub_posnA1stItmInTop_ary_testStd, etc] qnial> tstOptr "itm_posn1stInTop_ary_testStd l itm_posn1stInTop_ary 27 0 27 >> OK minor fixes to sub_posnA1stItmInTop_ary qnial> '_test' sub_posnA1stItmInTop_ary 'sub_compatible_ary_testStd' 18 >> OK qnial> tstOptr "sub_compatible_ary_testStd -->[stepv] resume o sub_compatible_ary 20 0 27 >> [null, atm] tests not passed through 08********08 #] 11Apr2022 itm_posn1stInTop_ary_test, itm_posnAInTop_ary, sub_posnA1stItmInTop_ary Redo tests of # 28Nov2021 +-----+ qnial> itm_posn1stInTop_ary 'Jan' ('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' ) 0 qnial> itm_posn1stInTop_ary 'Dec' ('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' ) 11 qnial> itm_posn1stInTop_ary 'Jun' ('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec' ) 5 qnial> itm_posn1stInTop_ary ` 'the bigg fat cow' 3 qnial> itm_posn1stInTop_ary `b 'the bigg fat cow' 4 qnial> itm_posn1stInTop_ary 'g' 'the bigg fat cow' ?address qnial> itm_posn1stInTop_ary 'g ' 'the bigg fat cow' ?address >> all responses are good, but tests fail? I must add fault-handling to itm_posn1stInTop_ary!! +-----+ # 29Nov2021 qnial> tstSimple itm_posnAInTop_ary_test >> OK, all correct (problem was '_test' at end of optrPhr) itm_posnAInTop_ary 7 7 # 29Nov2021 qnial> itm_posnAInTop_ary ` 'the bigg fat cow' 3 8 12 qnial> itm_posnAInTop_ary `b 'the bigg fat cow' 4 qnial> itm_posnAInTop_ary `g 'the bigg fat cow' 6 7 qnial> itm_posnAInTop_ary 'g' 'the bigg fat cow' >> null, arg is sub, not an item???? qnial> itm_posnAInTop_ary 'g ' 'the bigg fat cow' >> null, arg is sub, not an item???? qnial> itm_posnAInTop_ary 1 (link (tell 10) (tell 10)) 1 11 qnial> ' r!z' EACHLEFT itm_posnAInTop_ary 're-incarnated initial date - Iust have done this jillions of times before!' +--------------------------------+------+--++ |13 21 26 28 33 38 43 48 57 60 66|0 7 71|73|| +--------------------------------+------+--++ +-----+ # 09Dec2021 sub := ` ary := 'the bigg fat cow' qnial> posns := sub_posnA1stItmInTop_ary sub ary 3 8 12 # sub := ' b' ary := 'the bigg fat cow' qnial> posns := sub_posnA1stItmInTop_ary sub ary # qnial> sub := 2 3 2 3 qnial> ary := 3 4 reshape tell 30 0 1 2 3 4 5 6 7 8 9 10 11 qnial> posns := sub_posnA1stItmInTop_ary sub ary 2 3 # qnial> ary := 3 4 3 reshape tell 50 0 1 2 12 13 14 24 25 26 3 4 5 15 16 17 27 28 29 6 7 8 18 19 20 30 31 32 9 10 11 21 22 23 33 34 35 qnial> sub := 1 2 3 1 2 3 qnial> posns := sub_posnA1stItmInTop_ary sub ary 1 2 3 qnial> gage shape posns 1 1 3 +-----+ # sub_posnA1stItmInTop_ary (3 4 5) (tell 10) # sub_inTop_ary (3 4 5) (tell 10) +-----+ # EACH (gage shape) posn_dat sub_posnAAllItmInTop_ary_test # tstDatStd sub_posnAAllItmInTop_ary_test # qnial> [[1 0] [1 1] [1 2] [1 3]] +-------------------------+ |+-----+-----+-----+-----+| ||+---+|+---+|+---+|+---+|| |||1 0|||1 1|||1 2|||1 3||| ||+---+|+---+|+---+|+---+|| |+-----+-----+-----+-----+| +-------------------------+ qnial> [(1 0) (1 1) (1 2) (1 3)] +-----------------+ |+---+---+---+---+| ||1 0|1 1|1 2|1 3|| |+---+---+---+---+| +-----------------+ qnial> [[0 4]] +-----+ |+---+| ||0 4|| |+---+| +-----+ # 11Apr2022 what's going on? qnial> diagram [(1 0) (1 1) (1 2) (1 3)] +-------------------------+ |+-----+-----+-----+-----+| ||+-+-+|+-+-+|+-+-+|+-+-+|| |||1|0|||1|1|||1|2|||1|3||| ||+-+-+|+-+-+|+-+-+|+-+-+|| |+-----+-----+-----+-----+| +-------------------------+ qnial> diagram 1 2 3 4 +-+-+-+-+ |1|2|3|4| +-+-+-+-+ qnial> diagram [[1 0] [1 1] [1 2] [1 3]] +---------------------------------+ |+-------+-------+-------+-------+| ||+-----+|+-----+|+-----+|+-----+|| |||+-+-+|||+-+-+|||+-+-+|||+-+-+||| ||||1|0|||||1|1|||||1|2|||||1|3|||| |||+-+-+|||+-+-+|||+-+-+|||+-+-+||| ||+-----+|+-----+|+-----+|+-----+|| |+-------+-------+-------+-------+| +---------------------------------+ qnial> picture [(1 0) (1 1) (1 2) (1 3)] +-----------------+ |+---+---+---+---+| ||1 0|1 1|1 2|1 3|| |+---+---+---+---+| +-----------------+ qnial> picture [[1 0] [1 1] [1 2] [1 3]] +-------------------------+ |+-----+-----+-----+-----+| ||+---+|+---+|+---+|+---+|| |||1 0|||1 1|||1 2|||1 3||| ||+---+|+---+|+---+|+---+|| |+-----+-----+-----+-----+| +-------------------------+ qnial> picture ([1 0] [1 1] [1 2] [1 3]) +-----+-----+-----+-----+ |+---+|+---+|+---+|+---+| ||1 0|||1 1|||1 2|||1 3|| |+---+|+---+|+---+|+---+| +-----+-----+-----+-----+ a := sub_posnAAllItmInTop_ary 4 (tell 10) picture a diagram a b := [[4]] picture b diagram b maybe its a loaddefs thing? # 11Apr2022 unresolved structures of resultL +-----+ subL_posnAAllItmInTop_ary qnial> testOptrStr := 'subL_posnAAllItmInTop_ary_testSimple' subL_posnAAllItmInTop_ary_testSimple qnial> ('_test' sub_posnA1stItmInTop_ary testOptrStr) take testOptrStr subL_posnAAllItmInTop_ary What a mess!! # 05Dec2021 qnial> subL_posnAAllItmInTop_ary (' ' ' b') 'the bigg fat cow' +--------+-----+ |+-+-+--+|+---+| ||3|8|12|||3 4|| |+-+-+--+|+---+| +--------+-----+ qnial> a := subL_posnAAllItmInTop_ary ['g '] 'the bigg fat cow' +-----+ |+---+| ||7 8|| |+---+| +-----+ qnial> subL_posnAAllItmInTop_ary ('bigg ' 't') 'the bigg fat cow' +-----------+------+ |+---------+|+-+--+| ||4 5 6 7 8|||0|11|| |+---------+|+-+--+| +-----------+------+ qnial> subL_posnAAllItmInTop_ary ['around'] 'what goes around comes around' +-------------------------------------+ |+-----------------+-----------------+| ||10 11 12 13 14 15|23 24 25 26 27 28|| |+-----------------+-----------------+| +-------------------------------------+ qnial> subL_posnAAllItmInTop_ary ('[#=; ' ' ;=#]') '[#=; backtrack ;=#]Howell - Mega-Life, Mega-Death and the Sun, the rise and fall of civilisations.pdf' +-----------+----------------+ |+---------+|+--------------+| ||0 1 2 3 4|||14 15 16 17 18|| |+---------+|+--------------+| +-----------+----------------+ +-----+ subL_anyInTop_ary_test - optr is WRONG!!! optr change : +.....+ NOR (null EACHRIGHT = (sub_posnAAllItmInTop_ary subL ary)) +.....+ To : +.....+ subL_anyInTop_ary IS OP subL ary { OR (subL EACHLEFT sub_inTop_ary ary) } +.....+ # 04Oct2021 quick test to see what happens 3D qnial> a := 2 3 4 reshape (tell 100) 0 1 2 3 12 13 14 15 4 5 6 7 16 17 18 19 8 9 10 11 20 21 22 23 qnial> b := 2 3 4 reshape 'I have no idea of which situations involved illegal activities, which are within normal tax' I ha ea o ve n f wh o id ich qnial> o catenate a b ?left arg of fuse should be 0 qnial> 0 catenate a b 0 1 2 3 12 13 14 15 I h a e a o 4 5 6 7 16 17 18 19 v e n f w h 8 9 10 11 20 21 22 23 o i d i c h qnial> array_join_horizontal a b ?undefined identifier: ARRAY_JOIN_HORIZONTAL <***> A B qnial> aryA_join_horizontal a b 0 1 2 3 I h a 12 13 14 15 e a o 4 5 6 7 v e n 16 17 18 19 f w h 8 9 10 11 o i d 20 21 22 23 i c h +-----+ ary_to_atomL_test - OK, no changes # 13Feb2022 tests qnial> a := (fault '?1') 'my name is Sue' (l 9 l (l 6.7 l (o o (l o (fault '?3'))))) "hello `c (fault '?2') +--+--------------+------------------------------+-----+-+--+ |?1|my name is Sue|+-+-+-+----------------------+|hello|c|?2| | | ||l|9|l|+-+---+-+------------+|| | | | | | || | | ||l|6.7|l|+-+-+------+||| | | | | | || | | || | | ||o|o|l o ?3|||| | | | | | || | | || | | |+-+-+------+||| | | | | | || | | |+-+---+-+------------+|| | | | | | |+-+-+-+----------------------+| | | | +--+--------------+------------------------------+-----+-+--+ qnial> ary_to_atomL a ?1 m y n a m e i s S u e l 9 l l 6.7 l o o l o ?3 hello c ?2 qnial> diagram ary_to_atomL a +--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+-+-+-+-+-+--+-----+-+--+ |?1|m|y| |n|a|m|e| |i|s| |S|u|e|l|9|l|l|6.7|l|o|o|l|o|?3|hello|c|?2| +--+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+-+-+-+-+-+--+-----+-+--+ # olde code IF (OR EACH isAtm ary) THEN link ary ELSE link link EACH ary_to_atomL (link ary) ENDIF +-----+ atomA_restructSameAs_ary_test ?not an operation atomA_restructSameAs_ary_test 1 'pair' >> wow - blows up! oops - test array messed up ("tstSimple 1) -> ("tstSimple 2) still : ?not an operation come back to it in 2 days 08********08 #] 10Apr2022 start testing with 'arrays/arrays- testOptrs.ndf' start with single tests to fix tstStandard after changes qnial> tstStandard sub_checkFitIntoTop_ary_test +------------------------------------------------------+---------++ |?tstStandard error : incompatible n_datRows n_rowsRes|?no_value|| +------------------------------------------------------+---------++ ?tstStandard error : incompatible IDdatL IDresL : no_value ?no_value ?type error in fault >> Yuck! lots of work todo 08********08 #] 10Apr2022 sub_inTop_ary - doesn't exist : >>I put a new version in (old must have been list-based or something) sub_posnA1stItmInTop_ary IS OP sub ary >> doesn't work properly, tests don't work As per QNial startup arrangement, I need to fix arrays.ndf before file_ops.ndf!! >> too bad,but critical # 09Dec2021 qnial> sub := 2 3 2 3 qnial> ary := 3 4 reshape tell 30 0 1 2 3 4 5 6 7 8 9 10 11 qnial> subr := sub_checkFitIntoTop_ary sub ary 2 3 # qnial> ary := 3 4 3 reshape tell 50 0 1 2 12 13 14 24 25 26 3 4 5 15 16 17 27 28 29 6 7 8 18 19 20 30 31 32 9 10 11 21 22 23 33 34 35 qnial> sub := 1 2 3 1 2 3 qnial> subr := sub_checkFitIntoTop_ary sub ary 1 2 3 qnial> gage shape subr 1 1 3 # sub := ' b' ary := 'the bigg fat cow' qnial> posns := sub_checkFitIntoTop_ary sub ary # ?date? qnial> sub := 2 2 4 reshape tell 50 0 1 2 3 8 9 10 11 4 5 6 7 12 13 14 15 qnial> shape sub 2 2 4 qnial> cart EACH tell (shape sub) +-----+-----+-----+-----+ +-----+-----+-----+-----+ |0 0 0|0 0 1|0 0 2|0 0 3| |1 0 0|1 0 1|1 0 2|1 0 3| +-----+-----+-----+-----+ +-----+-----+-----+-----+ |0 1 0|0 1 1|0 1 2|0 1 3| |1 1 0|1 1 1|1 1 2|1 1 3| +-----+-----+-----+-----+ +-----+-----+-----+-----+ qnial> ary := 3 3 5 reshape tell 50 0 1 2 3 4 15 16 17 18 19 30 31 32 33 34 5 6 7 8 9 20 21 22 23 24 35 36 37 38 39 10 11 12 13 14 25 26 27 28 29 40 41 42 43 44 qnial> sub_checkFitIntoTop_ary sub ary >> null, so OK qnial> sub := 2 4 4 reshape tell 50 0 1 2 3 16 17 18 19 4 5 6 7 20 21 22 23 8 9 10 11 24 25 26 27 12 13 14 15 28 29 30 31 qnial> sub_checkFitIntoTop_ary sub ary ?sub_checkFitIntoTop_ary error shapeSub EACHLEFTRIGHT > shapeAry >> OK, works here 08********08 #] 08Apr2022 where am I? would like fileops to work in order to do backups >> no standard test operators yet - each is special qnial> loaddefs link d_Qtest 'fileops/fileops- test.ndf' +-----+ loading pZarchive_restore_test ?expecting end of block: CODEDRESULTL COMMENTL ) <***> loading pinn_searchL_grepTo_povrOrStdoutNull_output ?undefined identifier: FAULTL ( PINN_SEARCHL_GREPTO_POVRORSTDOUTNULL <***> PINN STRL OPTIONS +-----+ All tests write to screen - need to goto file now with well-formated file output by : aryPicture_writeTo_pout_pthTyp IS OP aryPicture pout pthTyp Classes of fault handling : 1. [l,o] no faults 2. [1, fault]L 3. combine [l, o, fault] 4. combos [result, fault]L (resFltL) 08********08 #] 07Apr2022 revamp link d_Qtest 'QNial test optrs.ndf' - simplify args (use phrases) optrPhr := phrase (5 dropright (string tstOptrPhr)) ; geany regexp multiline search ^(\t\t)\'(.*)\' replace \1"\2 reboot QNial, loaddefs [bool, str] tests 08Apr2022 fix optr isBoolean in link d_Qndfs 'types.ndf' >> not in file? nor link d_Qndfs 'boolean.ndf' ?!?!! qnial> isBoolean o l >> where is it defined? -> link d_Qndfs 'type_check.ndf' - nyet $ find "$d_Qndfs" -maxdepth 3 -name "*.ndf" | tr \\n \\0 | xargs -0 -IFILE grep --with-filename --line-number 'isBoolean' "FILE" >> nothing find "$d_Qndfs" -maxdepth 3 -name "*.ndf" | tr \\n \\0 | xargs -0 -IFILE grep --with-filename --line-number 'isBoolean' "FILE" >> nothing sheesh - I defind it where (system)? qnial> see "isBoolean ?system name link d_Qndfs 'boolean.ndf' : # boolean IS OP BoolChrIntPhrStr - convert [chr, str, int] to boolean -->[nextv] isBoolean o l -->[nextv] rows transpose mix datCols +-+-+-+-+-+-+--+---+---+---+ |o|l|l|5|0|1|-5|+-+|+-+|+-+| | | | | | | | ||o|||l|||5|| | | | | | | | |+-+|+-+|+-+| +-+-+-+-+-+-+--+---+---+---+ -->[nextv] optrPhr isBoolean -->[nextv] optrPhr EACHRIGHT apply (rows transpose mix datCols) oooooooooo >> OK except for first two -->[nextv] resStdL lloooooooo -->[nextv] isBoolean first first datCols l -->[nextv] isBoolean first first datCols l >> Good - so why is this corrupted? -->[nextv] b := (rows transpose mix datCols) +-+-+-+-+-+-+--+---+---+---+ |o|l|l|5|0|1|-5|+-+|+-+|+-+| | | | | | | | ||o|||l|||5|| | | | | | | | |+-+|+-+|+-+| +-+-+-+-+-+-+--+---+---+---+ -->[nextv] optrPhr EACHRIGHT apply b oooooooooo >> weird -->[nextv] c := first b o -->[nextv] isBoolean c o -->[nextv] diagram c +-+ |o| +-+ >> OK if single data col, all data are lists! optr change tstSimple : +.....+ calcL := optrPhr EACHRIGHT apply (rows transpose mix datCols) ; +.....+ To : +.....+ IF (= 1 n_inputs) THEN calcL := optrPhr EACHRIGHT apply first datCols ; ELSE calcL := optrPhr EACHRIGHT apply (rows transpose mix datCols) ; ENDIF ; +.....+ fix faults in data change resStdL for boolA_cut_ary_test : +.....+ t20-2 (fault '?boolA_cut_ary error, ~= (EACH (gage shape) boolA ary)') ; +.....+ To : +.....+ t20-2 (fault '?boolA_cut_ary error: ~= (EACH (gage shape) boolA ary)') ; +.....+ Many other corrections as well, 'boolA_cut_ary cannot cut a simple ary, use slice or EACH' etc Fundamental problem : boolA_splitJoin_ary IS OP boolA ary - boolean [split, join] ary into alternate [o, l] subs boolA_cut_indexA IS OP boolA - boolean boolA_cut_ary IS OP boolA list - extract a list of subArys by using [boolA, slice optr] boolA MUST "span remaining axis" - this optr CANNOT just leave non-existant "interior portions" of ary handy compliment to subList (standard QNial operator) boolA_keep_indexA IS OP boolA - boolean ary keeps contiguous "true" (l) subs, must span toplevel axis returns a split-up ary boolA_keep_ary IS OP boolA ary - extract an ary (array) of subArys from boolA ary of atoms (eg [strings, integer, real, complex, phrase, boolean]) must be made solitary if needed very tricky - this will be hard to use for complex arys, mayeven for simple arys? boolA_keep_ary IS OP boolA ary - extract subArys by using boolA, result is part of shape of ary boolA does not have to "span remaining axis" - this optr CAN just keep an "interior portion" of ary handy compliment to subList (standard QNial operator) >> must revamp [ary, bool] optrs - slices must be used for ary, not boolA!!! OK - 08********08 #] 06Apr2022 fix tstSimple - to accept testName as string, not phrase loaddefs link d_Qtest 'boolean/boolean- testOptrs.ndf' loaddefs link d_Qtest 'strings/strings- testOptrs.ndf' loaddefs link d_Qtest 'QNial test optrs.ndf' qnial> tstSimple 'bool_isBoolean_test' o isBoolean 8 0 9 >> OK qnial> tstSimple 'bool_NEQ_test' l ~= 4 0 4 >>OK qnial> tstSimple 'ary_indexA_convertTo_boolA_test' l ary_indexA_convertTo_boolA 3 0 3 >> OK AH - so the problem is that I didn't add '_test'? to optr name in groupTest IS OP groupNameStr clusterTest IS OP clusterName dir allTestNameL >> nyet - they are given '_test'! Try qnial> bool_clusterTest >> all fail, WHY? >> bool_allOptrs_groupTest - all test (optr) label ?no_value bool_clusterTest IS { NONLOCAL d_boolTests ; clusterTest 'BOOL_CLUSTERTEST' d_boolTests [ 'bool_allOptrs_groupTest' ] ; } Try qnial> clusterTest 'bool_allOptrs_groupTest' ?op_parameter >> OK - need to execute test name clusterTest execute 'bool_allOptrs_groupTest' >> oops, need groupTest? groupTest execute 'bool_allOptrs_groupTest' >> nope Try again with flag_break qnial> groupTest execute 'bool_allOptrs_groupTest' ... -->[nextv] groupPhr dirPhr testNameL ?no_value ?no_value ?no_value >> OK that's a problem -->[nextv] execute 'bool_allOptrs_groupTest' +-----------------------+-----------------------------------------------------------------------------+------- |bool_allOptrs_groupTest|/media/bill/Dell2/Website - raw/Qnial/code develop_test/boolean/test results/|+------ | | ||bool_i | | |+------ +-----------------------+-----------------------------------------------------------------------------+------- ------------------------------------------------------------+ -------------+-------------+------------+------------------+| sBoolean_test|bool_NEQ_test|bool_EQ_test|boolA_cut_ary_test|| -------------+-------------+------------+------------------+| ------------------------------------------------------------+ >> that's OK qnial> groupTest 'bool_allOptrs_groupTest' ... -->[nextv] groupPhr dirPhr testNameL >> OK result ?.. Grouprslt := link Grouprslt ( tstsimple Tstphr N_inputs Optrphr Dir Tstdat ) -->[nextv] +-+---------+-+-++ |o|?no_value|0|1|| +-+---------+-+-++ Change code! optr change : +.....+ FOR testName WITH testNameL DO tstTyp n_inputs optrPhr dir tstDat := execute testName ; IF ("tstSimple = tstTyp) THEN groupRslt := link groupRslt (tstSimple tstPhr n_inputs optrPhr dir tstDat) ; ELSEIF ("tstStandard = tstTyp) THEN % 14Feb2022 args must be adapted! ; groupRslt := link groupRslt (tstStandard tstPhr n_inputs optrPhr dir tstDatA tstResA) ; ELSE (link '?groupTest error, unknown tstTyp : ' (string tstTyp ) ', optr : ' (string optrPhr) ', testName : ' testName ) str_appendTo_paddOrScreen p_groupLog ; ENDIF ; ENDFOR ; +.....+ To : +.....+ >> nyeet - complicates things unnecessarily, go back to feeding variable to tstSimple! loaddefs link d_Qtest 'QNial test optrs.ndf' qnial> tstSimple bool_isBoolean_test o isBoolean 8 0 9 >> OK geany regexp multiline search ^(\t\t)\'(.*)\' replace \1"\2 qnial> groupTest bool_allOptrs_groupTest >> returns whole data ?no_value results each test 08********08 #] 05Apr2022 fix boolA_cut_ary (see "d_Qtest"'boolean/boolean- develop.txt'), then rerun tests first check test log 'boolA_cut_ary log.txt' >> not working at all play with optr definition, and d_Qtest 'boolean/boolean- testOptrs.ndf' tests >> added flag_break qnial> boolA_cut_ary llllolllll 'abcdefghij' +----+-----+ |abcd|fghij| +----+-----+ >> correct result, so what is wrong with that test? (except test whows solitary null!?) qnial> ['abcd' 'fghij'] +------------+ |+----+-----+| ||abcd|fghij|| |+----+-----+| +------------+ >> oops - test result with() not [] when multiple items!! The tests use [] improperly!! qnial> boolA_cut_ary ollllllllll 'abcdefgdefj' +----------+ |bcdefgdefj| +----------+ qnial> boolA_cut_ary (llllllllllo) 'abcdefgdefj' +----------+ |abcdefgdef| +----------+ qnial> boolA_cut_ary (lllolllolll) 'abcdefgdefj' +---+---+---+ |abc|efg|efj| +---+---+---+ 08********08 #] 05Apr2022 fix clusterTest in 'QNial test optrs.ndf' - I need overall summaries (too many tests!!) "$d_Qtest"'QNial test optrs.ndf' : clusterTest IS OP clusterName dir allTestL - run [tstSimple, tstStandard] on a cluster of group tests I simply added code to cat groupTest logs into cluster test log. Now, how do I loaddef the tests? OK initial QNial launch loads all normal optrs OK loaddef generic test optrs : d_Qtest 'QNial test optrs.ndf' OK loaddefs link d_Qtest 'strings/strings- testCluster.ndf' Now run : qnial> strings_clusterTest cat: '/media/bill/Dell2/Website - raw/Qnial/code develop_test/strings/test results/str_isIn_groupTest_groupTest log.txt': No such file or directory cat: '': No such file or directory cat: '/media/bill/Dell2/Website - raw/Qnial/code develop_test/strings/test results/str_cleanup_groupTest_groupTest log.txt': No such file or directory cat: '': No such file or directory cat: '/media/bill/Dell2/Website - raw/Qnial/code develop_test/strings/test results/str_convert_groupTest_groupTest log.txt': No such file or directory cat: '': No such file or directory cat: '/media/bill/Dell2/Website - raw/Qnial/code develop_test/strings/test results/str_unicode_groupTest_groupTest log.txt': No such file or directory cat: '': No such file or directory >> Oops ... qnial> strings_clusterTest qnial> bool_clusterTest >> Both work very nicely. >> 05Apr2022 need to add list of optrs NOT yet being tested [individual, group, cluster] - later >> 05Apr2022 individual test should take string na test, as with [group, cluster] tests boolA_cut_ary - need to fix this first? put apos arpund simple test args for d_Qtest : 'boolean/boolean- testOptrs.ndf' 'strings/strings- testOptrs.ndf' geany regexpr search # tstSimple ([a-zA-Z0-9_]*) replace # tstSimple '\1' 08********08 #] 05Apr2022 allow for bash summary of [group, cluster] tests based on individual test log outputs still able to do [individual, groupo, cluster] tests, important for type of code changes being made overall check - just run all individual tests, extract [correct, faults, total] numbers from >> "$d_Qtest"'test_summary.sh' - nyet QNial stuff is very good, modify that 08********08 #] 05Apr2022 I need overall summaries of [group, cluster] tests (too many tests!!) There are some in "$d_Qtest" : 'boolean/test results/BOOL_CLUSTERTEST log.txt' 'strings/test results/STRINGS_CLUSTERTEST log.txt' 1st look at 'boolean/test results/BOOL_CLUSTERTEST log.txt' : +-----+ BOOL_CLUSTERTEST start time : 220215 16h16m25s +--+-----------------------+-------+------+-----+ |OK|test (group) |correct|faults|total| +--+-----------------------+-------+------+-----+ | o|bool_allOptrs_groupTest| 16| 16| 44| +--+-----------------------+-------+------+-----+ finish time : 220215 16h16m25s +-----+ >> wrong list of groups (only one - I need at least group level info!?) >> wrong test totals $ ls -1 "$d_Qtest"'boolean/test results/' 3/3 ary_indexA_convertTo_boolA log.txt 0/14 boolA_cut_ary log.txt 2/5 bool_allOptrs_groupTest log.txt 3/3 boolA_splitJoin_ary log.txt 0/13 boolL_cut_ary log.txt 8/9 isBoolean log.txt 4/4 ~= log.txt 4/4 = log.txt 24/55 Second 'strings/test results/STRINGS_CLUSTERTEST log.txt' : $ ls -1 "$d_Qtest"'strings/test results/' Split up into two lists below : 1. $ ls -1 "$d_Qtest"'strings/test results/' 1st list - individual optr tests chrA_anyIn_strA log.txt chrL_anyIn_str log.txt str_isOf_chrSet log.txt strL_quoteUnifyForHostCmd log.txt str_option_isOf_chrSet log.txt str_removeExtra_SpcTab log.txt str_to_unicodeL log.txt strURL_clean log.txt strings_testAllOptrs IS { EACH tstSimple . chrL_anyIn_str_test . chrA_anyIn_strA_test . str_isOf_chrSet_test . str_option_isOf_chrSet_test . str_removeExtra_SpcTab_test . strURL_clean_test . strL_quoteUnifyForHostCmd_test . str_to_unicodeL_test x strL_to_strExecuteMirror_test x strLL_to_strExecuteMirror_test ; } >> OK, all accounted for in list of individual optr tests 2. $ ls -1 "$d_Qtest"'strings/test results/' 1st list - group tests str_cleanup_groupTest log.txt str_convert_groupTest log.txt str_isIn_groupTest log.txt str_unicode_groupTest log.txt strings_testAllGroups IS { EACH groupTest . 'str_isIn_groupTest' . 'str_cleanup_groupTest' . 'str_convert_groupTest' . 'str_unicode_groupTest' ; } >> OK, all accounted for in list of group tests +-----+ +--+---------------------+-------+------+-----+ |OK|test (group) |correct|faults|total| +--+---------------------+-------+------+-----+ | o|str_isIn_groupTest | 31| 31| 35| +--+---------------------+-------+------+-----+ | o|str_cleanup_groupTest| 2| 2| 12| +--+---------------------+-------+------+-----+ | o|str_convert_groupTest| 0| 0| 6| +--+---------------------+-------+------+-----+ | o|str_unicode_groupTest| 0| 0| 6| +--+---------------------+-------+------+-----+ finish time : 220215 13h17m12s +-----+ >> OK - all four groups shown Operators on hand 'strings/strings- testCluster.ndf' : * strings_testAllOptrs IS - direct individual testing of all selected, including special tests 08********08 #] 04Apr2022 resume work - where am I? # directory "d_Qndfs"'QNial [symbol, arg] changes/' - optrs etc to change symbols across system # '0_QNial symbol notes.txt' # '1_QNial symbol plan.txt' # '3_QNial symbol - draft listings to use for changes.txt' # testing optrs : # for all QNial programming : # "$d_Qtest"'QNial test optrs.ndf' # "$d_Qtest"'QNial test notes.txt' # for the project to revamp all my QNial symbol [name, arg[order, number]] : # "$d_Qtest"'QNial [symbol, arg] changes/' # 'Qndfs optr symbol changes - develop tests.txt' # 'Qndfs optr symbol changes - tools, ToDos.txt' # other .ndf test [files, subDirs] sequencing of testing follows p_Qsetup= link d_Qndfs 'QNial setup.ndf' # standard loaddefs : EACH loaddefs (link d_Qndfs 'QNial setup - header.ndf') (link d_symbols 'QNial userWkspSymbol header.ndf') (link d_symbols 'QNial userWkspSymbol.ndf') * (link d_Qndfs 'types.ndf') - spread out in files below? * (link d_Qndfs 'faults.ndf') - used by [op, test]s, errMsgs 'faults - header.ndf'? (link d_Qndfs 'boolean.ndf') - OK [ops, clus] (link d_Qndfs 'arrays.ndf') - OK [ops, group, clus] (link d_Qndfs 'lists.ndf') - NYET - in [ary,str]s? (link d_Qndfs 'strings.ndf') - OK [ops, group, clus] (link d_Qndfs 'file_ops.ndf') - special style, need to udate AFTER fix optrs above (link d_Qndfs 'windows.ndf') - NYET nothing yet (link d_Qndfs 'encryption.ndf') - NYET nothing yet (link d_Qndfs 'math - [quick, handy] stuff.ndf') - NYET nothing yet Also, many other [op, group, clus]... Legend : * a few tests in .ndf file check "$d_Qtest"'?clusterName?/test results' : each file is for a group of tests of a specific operator Is the cluster test optr working? 08********08 #] 15Feb2022 'QNial test optrs.ndf' continue revamp renamed allTest -> clusterTest changed file names working somewhat OK now, for sure more crections will be needed +-----+ # 14Feb2022 for [individual, group] test removals, # see : "$d_Qtest"'QNial test notes.txt' - res ipsa loquitor 08********08 #] 14Feb2022 string tests - many tests listed don't exist yet #] operators may have changed names (eg lst, ary, etc] [create, test] groupTest IS OP groupNameStr - run tests via groups of tests in d_Qtest 'strings/strings- testsGroup.ndf' many tests listed don't exist yet operators may have changed names (eg lst, ary, etc] # groups removed for now : # 14Feb2022 remove ALL for now : str_addTakeReplace_groupTest # 14Feb2022 remove ALL for now : str_split_groupTest # 14Feb2022 remove ALL for now : str_cutKeepStrip_groupTest # 14Feb2022 remove ALL for now : str_selfReturnExecute_groupTest -> not ready for fancy stuff now # individual tests removed for now : # 14Feb2022 remove for now : str_isIn_groupTest, 'subL_anyIn_lst_test' # 14Feb2022 remove for now : str_convert_groupTest, 'strL_eachQuoted_strOut_test' # 05Nov2021 missing for now - special set-aside test : 'strL_takeOddNum_test' 'str_addTakeReplace_groupTest' # 05Nov2021 problem for now - special set-aside test : 'str_splitAtFront_subStr_test1' +----+ Retry tests : loaddefs link d_Qtest 'strings/strings- testsGroup.ndf' groupTest 'str_isIn_groupTest' 08********08 #] 13Feb2022 revamp [tstSimple, tstDatStd, group_simpleTest], add write_tstResults create lstL_countFaults in 'faults.ndf' +-----+ # olde code n_cols := 3 ; n_rows := floor ((gage shape groupRslt) / n_cols) ; opNameL n_correctL n_totalL := cols (n_rows n_cols reshape groupRslt) ; OKL := n_correctL EACHBOTH = n_totalL ; % ; % write results to p_groupLog ; intro := (link (string groupName) ', start time : ' timestamp) '' ; EACH str_appendTo_paddOrScreen (list cart intro [p_groupLog]) ; tst_tbl := aryA_join_vertical (1 4 reshape 'OK' 'test (optr)' 'correct' 'total') (transpose mix OKL opNameL n_correctL n_totalL) ; aryPicture_writeTo_pout_pthTyp (picture tst_tbl) p_groupLog "padd ; ' ' (link 'finish time : ' timestamp_YYMMDD_HMS) ' ' EACHLEFT str_appendTo_paddOrScreen p_groupLog ; % ; % write summary results to p_groupLog ; intro (link (string sum OKL) '/' (string count OKL) chr_tab 'OK/total') EACHLEFT str_appendTo_paddOrScreen p_groupLog ; 08********08 #] 13Feb2022 'QNial test optrs.ndf' created groupTest, renamed allTest -> clusterTest still glitches with groupTest 08********08 #] 12Feb2022 status- tests on [type, fault, boolean, array, list, string, file_op, window]s see "$d_Qtest"'1_status- tests on [type, fault, boolean, array, list, string, file_op, window]s.txt' 08********08 #] 23Nov2021 update [tstSimple, group_subDir_test] tstSimple - I had added inputNum, adjust code accordingly tstSimple chrL_anyIn_str_test >> OK group_subDir_test IS OP tstGroup group_subDir_test str_cutKeepStrip_groupTest #] 24Nov2021 move ary position tests from 'strings- tests.ndf' to 'array- tests.ndf' add 'array- tests.ndf' to # QNial_user_symbol_changes_backup IS - back up core working files for this project # QNial_user_symbol_changes_loaddef_core IS - loaddef core working files for this project # enddoc