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

Include stanza.utils.visualization in distributions? #1421

Closed
bollwyvl opened this issue Sep 12, 2024 · 4 comments
Closed

Include stanza.utils.visualization in distributions? #1421

bollwyvl opened this issue Sep 12, 2024 · 4 comments

Comments

@bollwyvl
Copy link
Contributor

bollwyvl commented Sep 12, 2024

Is your feature request related to a problem? Please describe.

Looking to add (and at least smoke test) a downstream equivalent to stanza[visualization].

Trying to run something like:

import stanza.utils.visualization.semgrex_app

Fails with:

ModuleNotFoundError: No module named 'stanza.utils.visualization'

Describe the solution you'd like

Add stanza/utils/visualization/__init__.py.

Describe alternatives you've considered

  • do the above, and add some e.g. entry_points = {"console_scripts": []}
  • do nothing (don't ship a new conda-forge package)
  • ship without tests, and wait for users to find issues

Additional context

conda-forge/stanza-feedstock#20

@AngledLuffa
Copy link
Collaborator

Oof, thanks for catching that. I'll make a 1.9.1

@bollwyvl
Copy link
Contributor Author

Sorry to necropost this, and maybe I fully misunderstand the purpose of utils.visualization, but still not seeing a canary import work:

import stanza.utils.visualization.semgrex_app

  File ".venv/lib/python3.11/site-packages/stanza/utils/visualization/semgrex_app.py", line 5, in <module>
    import stanza.utils.visualization.ssurgeon_visualizer as ssv
  File ".venv/lib/python3.11/site-packages/stanza/utils/visualization/ssurgeon_visualizer.py", line 6, in <module>
    import stanza.utils.visualization.semgrex_visualizer as sv
  File ".venv/lib/python3.11/site-packages/stanza/utils/visualization/semgrex_visualizer.py", line 18, in <module>
    from utils import find_nth, round_base
ModuleNotFoundError: No module named 'utils'

Perhaps:

from stanza.utils.visualization.utils import find_nth, round_base

would clear this up?

@AngledLuffa
Copy link
Collaborator

I'm putting "only takes three tries to accomplish simple tasks" on my resume

@bollwyvl
Copy link
Contributor Author

Thanks again: restored the smoke test and it works fine downstream.

Still might want to consider adding and documenting some CLI entrypoints for those files rather than having to find them in the source tree to run them, but at least it imports!

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

No branches or pull requests

2 participants