-
Notifications
You must be signed in to change notification settings - Fork 52
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
topography sublibrary #1836
Merged
Merged
topography sublibrary #1836
Conversation
This file contains 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
kostmo
force-pushed
the
feature/structure-grid-expansion
branch
2 times, most recently
from
May 12, 2024 03:43
d7ec853
to
4632462
Compare
kostmo
force-pushed
the
feature/structure-grid-expansion
branch
from
May 25, 2024 23:01
4632462
to
9649d74
Compare
kostmo
force-pushed
the
refactor/topography-sublibrary
branch
from
June 1, 2024 19:23
0243f3b
to
6073826
Compare
kostmo
force-pushed
the
refactor/topography-sublibrary
branch
9 times, most recently
from
June 1, 2024 23:09
2d21acd
to
db04995
Compare
kostmo
added
the
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
label
Jun 2, 2024
kostmo
force-pushed
the
refactor/topography-sublibrary
branch
from
June 2, 2024 11:22
db04995
to
37b8842
Compare
byorgey
approved these changes
Jun 2, 2024
src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition.hs
Show resolved
Hide resolved
src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Registry.hs
Show resolved
Hide resolved
kostmo
force-pushed
the
refactor/topography-sublibrary
branch
from
June 2, 2024 20:37
37b8842
to
90a6360
Compare
kostmo
added
the
CHANGELOG
Once merged, this PR should be highlighted in the changelog for the next release.
label
Jul 7, 2024
kostmo
removed
the
CHANGELOG
Once merged, this PR should be highlighted in the changelog for the next release.
label
Jul 7, 2024
mergify bot
pushed a commit
that referenced
this pull request
Jul 14, 2024
Builds upon #1836. This PR moves functions that are independent of `Entity` type into a new module within `swarm-topography`, alongside most of the other structure recognizer code. Notably, this allows removal of the `AhoCorasick` dependency from the `swarm-scenario` sublibrary.
mergify bot
pushed a commit
that referenced
this pull request
Aug 12, 2024
Builds upon #1836. Most importantly in this PR, the `Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking` module is made generic in its `Entity` parameter, and is now able to be moved from the `swarm-engine` sublibrary to the `swarm-topology` sublibrary. I've also introduced an intermediate `RecognitionState` record inside `StructureRecognizer` to distinguish between the stateful and read-only elements. The `AhoCorasick` dependency is now reduced to only one sublibrary.
mergify bot
pushed a commit
that referenced
this pull request
Aug 13, 2024
Builds upon #1836. Ultimately, this allows us to move the final remaining module, `Precompute.hs`, into the `swarm-topology` sublibrary to live alongside the rest of the structure recognizer code. ## Also in this PR * improve logging details for shape recognition
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merge me
Trigger the merge process of the Pull request.
Z-Refactoring
This issue is about restructuring the code without changing the behaviour to improve code quality.
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.
Towards #1043.
The eventual goal of this sublibrary split is to have a self contained library that can compose 2D grids of arbitrary content (perhaps colored pixels, or boolean values). This could be useful outside of the
swarm
game.I would also like to write unit tests for the structure recognizer that are independent of the
Entity
type.Major Changes
Direction module
Swarm.Language.Syntax.Direction
toswarm-util
, since bothswarm-lang
andswarm-topology
depend on it, but not on each other.Swarm.Language.Syntax
Structure module
The
Swarm.Game.Scenario.Topography.Structure
module has been split into two:Swarm.Game.Scenario.Topography.Structure
Swarm.Game.Scenario.Topography.Structure.Type
The former retains the YAML parsing logic. The latter is agnostic of
Entity
type and the palette.At some future point, I might want to move the YAML parsing to this sublibrary while still retaining independence of
Entity
type.Structure recognizer
The structure recognizer is independent of the content of Cells (i.e. it does not need to know what an
Entity
is), except:Type parameters for three kinds of data have been added to the recognizer:
Cell
/PCell
Entity
EntityName
Eventually it may be possible to eliminate one or two of these type parameters, with some refactoring.