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

Simplify, upgrade, and type-stabilize dom_to_graph #891

Merged
merged 2 commits into from Feb 26, 2024
Merged

Conversation

KevinDCarlson
Copy link
Contributor

@KevinDCarlson KevinDCarlson commented Feb 23, 2024

DataMigrations.jl uses the dom_to_graph function to convert a category from a presentation to a graph so that it can be fed into the Limits functionality. At the same time it has to do some typecasting to handle the fact that its diagrams might containing at least three concrete types--SetFunctionCallable,SetFunctionId,FinDomFunctionInt--while also allowing for mutations during the process of populating partially defined diagram and then constructing bipartite graphs for the limit.

This PR modifies dom_to_graph to ensure that the output will always have dom a FinCatGraph, ob_map a vector of obtype, and hom_map a vector of homtype. There seems to be no reason as yet to allow codom(F) to be modified, although maybe there will be such a need someday.

Requesting a patch release. In some sense this is a breaking change since the old function wouldn't change a functor with domain other than a FinCatPresentation, but I don't have any reason to believe this function's ever been called outside of the DataMigrations.jl context. And the breaking could only occur if somebody was relying excessively on implementation details of the input functor such as the ob_map being a Dict anyway--this function doesn't change the functor's semantics.

Copy link
Member

@epatters epatters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kevin, this is a good change. And I agree that it should not require a breaking release.

src/categorical_algebra/FinCats.jl Outdated Show resolved Hide resolved
@epatters epatters merged commit 73af574 into main Feb 26, 2024
10 checks passed
@epatters epatters deleted the improveDomToGraph branch February 26, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants