-
Notifications
You must be signed in to change notification settings - Fork 44
Refactoring of Generators #118
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
Draft
rpgoldman
wants to merge
12
commits into
logic-and-learning-lab:main
Choose a base branch
from
rpgoldman:cc3-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+652
−455
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code formatting issues from the linter. Pruned imports per linter Provide more information in error-handler. Replace error print statements with logging messages at error level. Tweak error handling.
Removed mutable default values. Removed equality comparisons against None.
Looking at the README in the PyCharm IDE, discovered that it incorrectly referenced `print_prog_score`. This is not a function, but a method on `Settings`.
Change to explicitly make the default logging level be WARNING.
I am going to rewrite the history here and then force push it -- the history is a little ugly at present. |
Add `resource_string.py` that provides a compatibility layer between versions of Python that do and don't have the `pkg_resources` library, removed in version 3.12.
Create two new methods, `build_encoding` and `init_solver` that encapsulate the set up of the solver. Did this for my own purposes, but it simplifies the code, as well, and could be used later to reduce code duplication.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft of refactoring of Popper's generators. Adds an abstract class that is the parent of the three alternate generators.
loop.py
now imports all three of them, and addsPopper.select_generator()
method to encapsulate the choice process.This is very unlikely to be ready for adoption, but it seems not to break anything, based on test runs, and I hoped it would be of interest.
I did this to make it possible to tailor generators, but it also has the advantage of making it possible for type checkers and other linters to check the generator code and how it's used in the rest of Popper.
I added a couple of new type definitions into abs_generate.py, which caused a little fuss because these use type definitions from popper.util. Although this is circular, it's not a problem when type-checking (see the wrapping of imports at the head of
abs_generate.py
). But it's untidy; it would probably be more elegant to have a file of miscellaneous type definitions w/o code that could be loaded early in load order.The diff is ugly, I'm afraid, because this was built on top of the linter improvements in #115. If that can be merged, then the diffs here would clean up.