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 long import times #397

Closed
lukew3 opened this issue Dec 19, 2022 · 0 comments · Fixed by #405
Closed

Fix long import times #397

lukew3 opened this issue Dec 19, 2022 · 0 comments · Fixed by #405
Labels
bug Something isn't working

Comments

@lukew3
Copy link
Owner

lukew3 commented Dec 19, 2022

Bug Description

It takes about 0.5 seconds to import the library. I think that the main issue causing this is the fact that all generators need to be instantiated on load.

Why we are using a Generator class:

  • Hold an integer Id that identifies a generator despite new generators being added
  • Hold metadata about a generator that can be used to build documentation
  • Gain access to methods shared by all instances such as conversion to latex/asciimath format

Possibilities for how to best restructure:

  • Each generator file simply contains a generator function, independent from any classes
  • Generator files contain comments describing what they do
    • Docstrings
    • Maybe this would have to be python variables representing data, but this may cause memory issues
  • A seperate txt file lists all generators in the order that they were added. This should contain the subject/generator_name
    • If a generator is deleted, it can be replaced with something like DELETED
    • Should be a function that can read this file into a python list and give it to the user
      • Another function should do the same thing but read metadata from each file and create a list similar to what getGenList does currently.
  • Maybe have top-level functions that can take output from a generator and change formatting
@lukew3 lukew3 added the bug Something isn't working label Dec 19, 2022
@lukew3 lukew3 mentioned this issue Dec 23, 2022
6 tasks
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

Successfully merging a pull request may close this issue.

1 participant