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

Fix create_adjacent_tables.py #15

Closed
5 tasks done
griff-rees opened this issue Jul 3, 2023 · 4 comments
Closed
5 tasks done

Fix create_adjacent_tables.py #15

griff-rees opened this issue Jul 3, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@griff-rees
Copy link
Contributor

griff-rees commented Jul 3, 2023

create_adjacent_tables.py is currently a script outside alto2txt2fixture folder. This is a meta ticket for improving that script, both for debugging and to include as a module within alto2txt2fixture to facilitate a public, installable release.


Fixes to be usable for lwmdb


Packaging/documenting

@griff-rees
Copy link
Contributor Author

griff-rees commented Jul 3, 2023

Initial errors:

$ poetry run python -m create_adjacent_tables.py
Downloading cache/Mitchell_1846_1920.csv
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/Users/grees/code/alto2txt2fixture/create_adjacent_tables.py", line 106, in <module>
    wget.download(url=url, out=out)
  File "/Users/grees/Library/Caches/pypoetry/virtualenvs/alto2txt2fixture-GJR6xUmf-py3.11/lib/python3.11/site-packages/wget.py", line 506, in download
    (fd, tmpfile) = tempfile.mkstemp(".tmp", prefix=prefix, dir=".")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tempfile.py", line 341, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tempfile.py", line 253, in _mkstemp_inner
    file = _os.path.join(dir, pre + name + suf)
                              ~~~~^~~~~~
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

@griff-rees
Copy link
Contributor Author

griff-rees commented Jul 3, 2023

Issue above reproduced with tests in 15472b5

@griff-rees griff-rees changed the title Refactor create_adjacent_tables.py Fix create_adjacent_tables.py Jul 4, 2023
@griff-rees griff-rees added the bug Something isn't working label Jul 4, 2023
@AoifeHughes
Copy link
Collaborator

Output looks sensible in current main branch output - will close once verified and documentation is updated as per original comment here

@griff-rees
Copy link
Contributor Author

Closing now documentation shifted to separate issue #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants