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.
This PR is a collection of refactors and changes I've made to make the library work better as a generic WFC library.
Waves are now resolved without a recursive call. The library no longer needs to mess with the Python recursion limit. These changes left a recursion-specific test to become unused, so I've removed that test.
I've replaced several print calls with the Python logging module. This will prevent excessive printing on the console without actually removing that logging capability.
wfc_run.py
still shows all of these logs.Several type hints were updated, some because of bugs in the previous type hinting and others because the functions are more flexible than they were originally hinted. The hinting allowed me to refactor how the tile catalog was generated so that the output image will now have the same dtype as the input.
The
execute_wfc
function had several changes, the default parameters are better and the function can now take an image directly instead of a filename (not passing a filename will disable a lot of logging tools.) It also returns the visual image instead of the image tiles which were useless since the tile catalog wasn't returned with them. It now raises exceptions instead of returning None for failed runs which makes error handing easier.The
makeSearchLengthLimit
constraint was mislabeled and caused bugs, so it's been removed. Right now there's no way to set a depth or iteration limit but there's nothing that seems to need one.Closes #7, most of my issues are addressed by this PR, any remaining issues can later be raised as a separate issue.
Closes #8, this dev was trying to generate images without file I/O, which this PR supports.