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

[Bug]: Initializing an empty ATG results in RecursionError #169

Closed
1 task done
chrisbrickhouse opened this issue Feb 27, 2024 · 2 comments
Closed
1 task done

[Bug]: Initializing an empty ATG results in RecursionError #169

chrisbrickhouse opened this issue Feb 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@chrisbrickhouse
Copy link
Member

Contact Details

No response

What happened?

Reproduce with the following

import aligned_textgrid as atg
tg = atg.AlignedTextGrid()

Unclear what the expected output here is. On the one hand, I would like to be able to instantiate an empty textgrid. On the other hand, I can see why it might be more user friendly to keep people on rails and fail if there's nothing there. In the first case, we should initialize the expected attributes as empty. In the second case, we should give a more helpful error than RecursionError which doesn't give a sense of what the problem is.

What operating system are you using?

Ubuntu

Relevant log output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cj/Linguistics/FAVE-org/textgrid-dataset/dev/lib/python3.11/site-packages/aligned_textgrid/aligned_textgrid.py", line 71, in __init__
    self.tier_groups = self._relate_tiers()
                       ^^^^^^^^^^^^^^^^^^^^
  File "/home/cj/Linguistics/FAVE-org/textgrid-dataset/dev/lib/python3.11/site-packages/aligned_textgrid/aligned_textgrid.py", line 251, in _relate_tiers
    for tier_group, classes in zip(self.tg_tiers, self.entry_classes):
                                   ^^^^^^^^^^^^^
  File "/home/cj/Linguistics/FAVE-org/textgrid-dataset/dev/lib/python3.11/site-packages/aligned_textgrid/aligned_textgrid.py", line 121, in __getattr__
    tier_group_names = [x.name for x in self.tier_groups]
                                        ^^^^^^^^^^^^^^^^
  File "/home/cj/Linguistics/FAVE-org/textgrid-dataset/dev/lib/python3.11/site-packages/aligned_textgrid/aligned_textgrid.py", line 121, in __getattr__
    tier_group_names = [x.name for x in self.tier_groups]
                                        ^^^^^^^^^^^^^^^^
  File "/home/cj/Linguistics/FAVE-org/textgrid-dataset/dev/lib/python3.11/site-packages/aligned_textgrid/aligned_textgrid.py", line 121, in __getattr__
    tier_group_names = [x.name for x in self.tier_groups]
                                        ^^^^^^^^^^^^^^^^
  [Previous line repeated 993 more times]
RecursionError: maximum recursion depth exceeded

Code of Conduct

  • I agree to follow this project's Code of Conduct
@JoFrhwld
Copy link
Member

This, #168 and #167 feel very broadly related to better programmatic creation of AlignedTextGrids within the package, rather than just processing and editing already existing textgrids. I think it's the right next step, so I've created a project for it, and added these issues to a v0.7 milestone.

Depending on the urgency with which you need these updates for your workflow, I'm happy to merge and publish patch updates to v0.6 as we go.

@chrisbrickhouse
Copy link
Member Author

chrisbrickhouse commented Feb 28, 2024

broadly related to better programmatic creation of AlignedTextGrids within the package

Yep, though technically the docs state all arguments to AlignedTextGrid.__init__ are optional, so according to the API it should work with no arguments, hence why this one is marked as a bug and the others are feature requests.

I'm happy to merge and publish patch updates to v0.6 as we go.

I don't need urgent updates to v0.6. For local development I just roll my own patches. Plus I'd rather preserve semantic versioning, so I'm generally against adding new features without at least a minor version bump.

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
Development

No branches or pull requests

2 participants