Rewriting asciimaps to be functional #1767
Open
+1,812
−3
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.
What is the change?
Added 2 additional files,
asciimaps_functional.py
andtest_asciimaps_functional.py
which contain a function-based approach treating an ASCII map as a dictionary comprised of multiple keys with the respective components, rather than using a class-based approach that is used inasciimaps.py
andtest_asciimaps.py
currently.Additionally, the 2 implementations of the asciimaps utility in
gridBlueprint.py
have been changed to use the proper function call structure. Currently, theasciiMapFromGeomAndDomain()
has not been validated as an appropriate unit test is not contained in test_asciimaps.py.PyTest passes everything except for
asciiMapFromGeomAndDomain()
Why is the change being made?
The problem: an
asciimaps
object is required to call a function within that class.After reading the discussion for issue #436, It was deemed appropriate by my academic advisor, Dr. Andrew Kirby to refactor the asciimaps.py and its accompanying unit tests to use a function-based approach rather than the existing class-based approach. This is not a perfect submission, merely a jumping-off point to make
asciimaps.py
more extensible and usable for the maintainers of this project.close #436
Checklist
doc
folder.pyproject.toml
.