Skip to content

Need a range with only one call number #23

@tdilauro

Description

@tdilauro

I need to be able to support a range that contains a single call number, but I get the following traceback. Is there an implementation issue that would make such a range unsafe?

Traceback (most recent call last):
  File "/Users/timmo/.PyEnvs/python-NadIChSC/lib/python3.7/site-packages/pycallnumber/set.py", line 166, in __init__
    self._validate(start, end)
  File "/Users/timmo/.PyEnvs/python-NadIChSC/lib/python3.7/site-packages/pycallnumber/set.py", line 187, in _validate
    raise BadRange('The range\'s ``start`` argument must be less than '
pycallnumber.exceptions.BadRange: The range's ``start`` argument must be less than its ``end`` argument.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/timmo/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/182.4505.26/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
    main()
  File "/Users/timmo/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/182.4505.26/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Users/timmo/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/182.4505.26/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/timmo/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/182.4505.26/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/Shared/src/git/gis/msel-collections/python/lookup.py", line 40, in <module>
    main()
  File "/Users/Shared/src/git/gis/msel-collections/python/lookup.py", line 18, in main
    lookup_table = sorted(lookup_rows, key=itemgetter(range))
  File "/Users/Shared/src/git/gis/msel-collections/python/lookup.py", line 28, in lookup_table_generator
    row['range'] = pycn.cnrange(start, end)
  File "/Users/timmo/.PyEnvs/python-NadIChSC/lib/python3.7/site-packages/pycallnumber/factories.py", line 81, in cnrange
    return rangesettype((start, end))
  File "/Users/timmo/.PyEnvs/python-NadIChSC/lib/python3.7/site-packages/pycallnumber/set.py", line 339, in __init__
    ranges.append(Range(*rg))
  File "/Users/timmo/.PyEnvs/python-NadIChSC/lib/python3.7/site-packages/pycallnumber/set.py", line 169, in __init__
    ''.format(start, end, e))
pycallnumber.exceptions.BadRange: The range AC5. S635 1972  QUARTO to AC5. S635 1972  QUARTO did not validate: The range's ``start`` argument must be less than its ``end`` argument.

Process finished with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions