Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can't recreate same order of 1-link subsystems in correct_out_prep.txt (neither with run_prepare_test.bat nor with sdnaprepare). #20

Open
JamesParrott opened this issue Feb 13, 2024 · 4 comments

Comments

@JamesParrott
Copy link
Collaborator

JamesParrott commented Feb 13, 2024

Maybe this is just my setup, or my machine. But there might be something subtle that's changed with the C++ iterators

correct_out_prep.txt (expected), id = 1073 is output before id = 246

sDNA sdnaprepare config: action=repair;splitlinks;isolated;nearmisses;duplicates;xytol=0.01
  Using xytolerance=0.01, ztolerance=0
Input has 21732 rows

...

3-link subsystem contains link with id = 8468
2-link subsystem contains link with id = 4103
1-link subsystem contains link with id = 1073
1-link subsystem contains link with id = 246
1-link subsystem contains link with id = 272
1-link subsystem contains link with id = 4251
1-link subsystem contains link with id = 4651

...

https://github.com/fiftysevendegreesofrad/sdna_plus/blob/main/sDNA/sdna_vs2008/tests/correctout_prep.txt

Actual, id = 246 & 272 are output before id = 1073:

sDNA sdnaprepare config: action=repair;splitlinks;isolated;nearmisses;duplicates;xytol=0.01
  Using xytolerance=0.01, ztolerance=0
Input has 21732 rows

...
3-link subsystem contains link with id = 8468
2-link subsystem contains link with id = 4103
1-link subsystem contains link with id = 246
1-link subsystem contains link with id = 272
1-link subsystem contains link with id = 1073
1-link subsystem contains link with id = 4251
1-link subsystem contains link with id = 4651

To reproduce, install sDNA and numpy, cd to sDNA\sdna_vs2008\tests:

set "sdnadll=c:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll" & set outputsuffix=py3 & python -u ..\..\..\arcscripts\bin\sdnaprepare.py -i prep_crash_shapefile\shapefilepreparecrash -o prep_crash_shapefile\out_%outputsuffix% --dll "%sdnadll%"  "action=repair;splitlinks;isolated;nearmisses;duplicates;xytol=0.01"

or set the env variables and run_prepare_test.bat

out_py3.zip

@JamesParrott
Copy link
Collaborator Author

The same thing just happened with the 3-link subsystems on Python 3.7, so perhaps the underlying cause probably is stochastic.

PASSED test_gathering_windows_command_line_tests.py::test_diff_[correctout_table.txt]
PASSED test_gathering_windows_command_line_tests.py::test_diff_[correctout_od.txt]
PASSED test_gathering_windows_command_line_tests.py::test_diff_[correctout_geom.txt]
FAILED test_gathering_windows_command_line_tests.py::test_diff_[correctout_prep.txt] - AssertionError: Error on line num i: 18.  This line (and up to the 9 previous ones):
  Expected: "Reading features from prep_crash_shapefile\shapefilepreparecrash
    sDNA is running in 64-bit mode
    Fixing near miss connections
    Fixing duplicate links
    Checking for isolated systems
    Largest system contains 21523 links
  7-link subsystem contains link with id = 8285
  6-link subsystem contains link with id = 9654
  4-link subsystem contains link with id = 8028
  3-link subsystem contains link with id = 9920
  ", 
  
   Actual: "Reading features from prep_crash_shapefile\shapefilepreparecrash
    sDNA is running in 64-bit mode
    Fixing near miss connections
    Fixing duplicate links
    Checking for isolated systems
    Largest system contains 21523 links
  7-link subsystem contains link with id = 8285
  6-link subsystem contains link with id = 9654
  4-link subsystem contains link with id = 8028
  3-link subsystem contains link with id = 8090
"
assert '3-link subsy...ith id = 8090' == '3-link subsy...ith id = 9920'
  - 3-link subsystem contains link with id = 9920
  ?                                           --
  + 3-link subsystem contains link with id = 8090
  ?                                          ++
======================== 1 failed, 9 passed in 11.85s =========================

@fiftysevendegreesofrad
Copy link
Owner

Is this a 32 bit dll vs 64 bit dll issue perhaps?

@JamesParrott
Copy link
Collaborator Author

Possibly, if the original correctout.txts came from a 32 bit dll, and the v4.1.1 is 64 bit. I'm not sure why that would make this (and issue #21) intermittent though.

@JamesParrott
Copy link
Collaborator Author

Temporary work around. By setting the environment variable DONT_TEST_N_LINK_SUBSYSTEMS_ORDER, this issue can be ignored by the regression tests.

# Configure allowing regression tests to pass despite issue #20

e.g. the calling workflows do this by setting the input of the same name on the custom Action:

DONT_TEST_N_LINK_SUBSYSTEMS_ORDER:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants