-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add KnotTheory as a provided package. #1358
base: master
Are you sure you want to change the base?
Conversation
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.
Just to know, is this loading now? Maybe we can add a few tests for this package.
@mmatera Two tests have been added. But this now really slows down testing since loading KnotTheory is slow as is memory cleanup after the test finishes. |
OK, once we pass the tests, we can just comment it out, and keep it for when we have a faster kernel or a specific module. |
Interestingly it works for both me and @soehms who I got it from. So there is something weird going on here. Probably the test would just be that we can load the package. But I need to defer looking at this until later. |
I checked it, and for some reason, the test passes if you run it alone |
Let's keep it commenting the test. We also need to put the reference of the original source of the knoththeory package in the AUTHORS.txt file. |
interesting.
Sure. This is not the end of this. |
6523d29
to
5626fbb
Compare
@mmatera In 5626fbb we get closer. If you know off hand the right rule for As for Attribution would go inside the package and that makes sense too. When the package is moved the attribution goes with it. However, I don't see any special files giving credit or mention. We do refer to http://katlas.org/wiki/The_Mathematica_Package_KnotTheory but that doesn't give attribution either. |
test/test_knottheory.py
Outdated
|
||
|
||
@pytest.mark.skipif(not os.environ.get("KnotTheory", False), | ||
reason="set environment varable KnotTheory to run this test") |
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.
that's a clever solution!
mathics/builtin/scoping.py
Outdated
@@ -650,6 +649,9 @@ class BeginPackage(Builtin): | |||
Protect[System`Private`$ContextPathStack, System`$Packages]; | |||
context | |||
""", | |||
# "BeginPackage[context_String, needs_List]": """ |
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.
Uncomment this
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.
Given that when this is uncommented it causes a slew of errors in running the long-running test, I am not totally convinced it is correct. Possibly down the line there will be code checking that all items in the list are strings.
So for me at least this is a placeholder. I welcome though filling this out. We also probably need to add a test if it is in place.
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.
In that case, let me suggest adding a rule like
"BeginPackage[context_String, needs_List]":
"""Print["Current kernel does not support the second argument ",needs, ". Please load them explicitly inside the package"]; BeginPackage[context]"""
in a way that the main package be loaded, and helps the user to detect what could go wrong.
70dc933
to
cdeb740
Compare
Regarding the full thing, since the tests are so heavy, I think that the best would be to maintain for now an independent repository for KnothTheory and Feyncalc mathics packages. We can test there against "experimental" specific branches inside Mathics, in a way that we can update on both sides as we make progress in the support for the required symbols. |
Sure, I tried setting this up separately, but wasn't able to do in the time I had allotted for it. If you want to do - go ahead. For now this can just live here. |
1e94b57
to
4e8192f
Compare
b007e8c
to
ef16eb6
Compare
8367d69
to
83bb068
Compare
9570fdd
to
499f1bf
Compare
I've experimented with that branch (merged with current master) and it seems that there is a problem with importing dependent files. If I work on master branch with a copy of the original files form http://katlas.org in the local path then the tests I made last May still work.
But, if I work on
Observe, that you get |
Workaround: ``` BeginPackage["KnotTheory`", {"TubePlot`"}] ``` More generally, `BeginPackage[string, needs_list]` doesn't work. Run `test/test_knottheory.py` only if KnotTheory environment variable is set.
Update CHANGES.rst to reflect we have added KnotTheory.
And one that isn't without error.
ed53971
to
03cc2f0
Compare
4832059
to
4dd291e
Compare
No description provided.