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

Base.similar method for acsets #65

Open
KevinDCarlson opened this issue Oct 10, 2023 · 1 comment
Open

Base.similar method for acsets #65

KevinDCarlson opened this issue Oct 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@KevinDCarlson
Copy link

There are some places in the code (for instance in the nauty integration, but I bet not just there) where we copy or even deepcopy a whole acset just to get an acset of the same shape that we'll then overwrite. It might be nice to write a method of Base.similar that copies an acset's shape (i.e. attrtypes and cardinalities of homs) but leaves everything uninitialized for this kind of situation. I don't know enough about columns to know whether this would be trivial or annoying.

@epatters epatters added the enhancement New feature or request label Oct 11, 2023
@epatters epatters changed the title Similar(X::ACSet) similar method for acsets Oct 11, 2023
@epatters epatters changed the title similar method for acsets Base.similar method for acsets Oct 11, 2023
@epatters
Copy link
Member

epatters commented Oct 11, 2023

Good idea. It should be straightforward to implement this feature without reaching into the internals. Just create an empty acset of the same type (I think/hope Base.empty is already implemented for acsets) and call add_parts! without setting any subparts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants