Hi Benjamin,

you are right. There is a two-page scan in my data where the survey ID was not detected.

Thank you very much for providing the fix! Works without problems now. :)

Christian


Am 24.08.2018 um 05:55 schrieb Benjamin Berg:
Hi,

this is actually what the pull request from David was about
   https://github.com/sdaps/sdaps/pull/135

I have now pushed a fix for the issue by wrapping the sorting into a
try/except block. This should result in the same order that the scan
had.

When you run into this issue, it probably means one of two things:
  1. You did not yet run the recognise step (on some scans)
  2. The page number/survey ID was not detected, and the scan is
     unusable for recognition due to this.

Changing it to "new_images = self.survey.sheet.images" will work
completely fine in most cases. A slightly better workaround would be to
just remove the sorted() call and leave the filtering in.

Benjamin

On Thu, 2018-08-23 at 19:21 +0200, Christian Werner wrote:
Hi *,

First, I would like to thank you for this great piece of software!
Although I am working with sdaps for only a few days it already saved
a
lot of my time!

However, when trying out the latest release (1.9.2) using the files
from
http://sdaps.org/releases/sdaps-1.9.2.tar.gz I get stuck with the
following python stack trace:

===
cwerner@host ~/sdaps $ sdaps ./myproj gui
-------------------------------------------------------------------
-----------
- SDAPS -- gui
-------------------------------------------------------------------
-----------
Traceback (most recent call last):
    File "/usr/local/lib/python3.6/dist-packages/sdaps/__init__.py",
line
65, in main
      return cmdline['_func'](cmdline)
    File "/usr/local/lib/python3.6/dist-packages/sdaps/script.py",
line
105, in decorated_function
      result = function(cmdline)
    File "/usr/local/lib/python3.6/dist-
packages/sdaps/cmdline/gui.py",
line 43, in gui
      return gui.gui(survey, cmdline)
    File "/usr/local/lib/python3.6/dist-
packages/sdaps/gui/__init__.py",
line 57, in gui
      provider = Provider(survey, filter)
    File "/usr/local/lib/python3.6/dist-
packages/sdaps/gui/__init__.py",
line 80, in __init__
      self.survey.iterate(self, filter)
    File "/usr/local/lib/python3.6/dist-
packages/sdaps/model/survey.py",
line 366, in iterate
      function(*args, **kwargs)
    File "/usr/local/lib/python3.6/dist-
packages/sdaps/gui/__init__.py",
line 96, in __call__
      new_images = [img for img in sorted(self.survey.sheet.images,
key=lambda Image: Image.page_number) if not img.ignored]
TypeError: '<' not supported between instances of 'NoneType' and
'NoneType'
===

If I change line 96 of
"/usr/local/lib/python3.6/dist-packages/sdaps/gui/__init__.py" to

===

new_images = self.survey.sheet.images

===

everything seems to work smoothly (i.e. gui is starting and working
as
expected).

Two question:

- Is sorting mandatory at this point? At least on my data the
simplified
version of line 96 seems to work correctly.
- Since I am not a python programmer, I am not sure how to debug
this
issue properly. Is there an easy way to figure out why there is a
comparison between two 'NoneTypes' on my data?

Best regards,

Christian






--
To unsubscribe, send mail to [email protected].

Reply via email to