-
Notifications
You must be signed in to change notification settings - Fork 57
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
Subobject image/preimage, completion of a partial subobject #605
Conversation
Review ChecklistDoes this PR follow the development guidelines? Following is a partial checklist: Tests
Documentation
Other
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks great, just have a few comments and a question on the docstrings. Looking forward to inducing subobjects!
Looks like the test suite is failing on the new tests (though you may already be aware of that). |
1b75e25
to
701cdd3
Compare
This is repeatedly failing on generating the code for one of the docstrings. I'm wondering if one of the added docstrings is unintentionally being interpreted as code for documenter to execute? (error here https://github.com/AlgebraicJulia/Catlab.jl/runs/5409417886?check_suite_focus=true#step:6:97). |
Hm this error is weird because it seems to be in a completely unrelated file. For generating docs locally: running
Note that error is different from the one github is reporting. For the local error, I think the problem occurs when My environment:
|
This should be fixed in #607. Try rebasing off master. |
118e9e7
to
7ca7ffa
Compare
So, I think that it's not the actual content of the comments, but instead the fact that there are docstrings on your |
This looks like a similar issue, though it's not the exact same situation (though the same error) |
Sorry it's taken me so long to get back to this! If you remove the return types, the docs will build even with the docstrings
to
Not sure if that causes any performance or enforcement issues on Julia's side, but it'll let you write docstrings for these functions. So it currently is just a choice between docstrings and return types from what I can see. Any thoughts on this tradeoff @epatters @kris-brown ? |
I'm pretty sure return type annotations just add a runtime type assert for the return value, so removing them shouldn't break anything. That said, having them obviously shouldn't break the docs build. Looks like a bug in Documenter. I just upgraded Documenter to the latest version (#626). Can you see if that fixes the problem? |
Unfortunately it looks like this is still breaking, so we're still stuck with choosing between an explicit return type and docstrings. |
Since it's quite common in Catlab for methods to not have return types but uncommon to have pseudo-docstrings with |
Agreed. The return type is less important than the docstring. We should also file an issue with Documenter.jl. |
I've filed an issue here (JuliaDocs/Documenter.jl#1810) Once the return type is removed and the docs build, I'll be ready to approve this PR for merging! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the changes!
The documenter issue has been closed with this PR JuliaDocs/Documenter.jl#1811, which provides workarounds for docstrings on functors. The expected behavior still doesn't work, and is dependent on the resolution of this Julia issue JuliaLang/julia#45174 |
important content of this is now incorporated into #777 |
These functionalities for subobjects are code I find myself rewriting repeatedly, so they may be of use to others too (if they're not already in Catlab).
Because I often want to 'apply' a homomorphism to some concrete data, this becomes a map of subobjects from the domain to the codomain. We likewise can use preimages to get maps in the other direction (I'd like a better syntax for inverses, but for now it's a named function
hom_inv
).Also, I often want, e.g., the wiring diagram induced by wires 3, 4, and 7 - so
induce_subobject
will do the iterative search so that the subobject doesn't have 0's everywhere.