gap-packages / francy Goto Github PK
View Code? Open in Web Editor NEWAn Interactive Discrete Mathematics Framework for GAP
Home Page: https://gap-packages.github.io/francy/
License: MIT License
An Interactive Discrete Mathematics Framework for GAP
Home Page: https://gap-packages.github.io/francy/
License: MIT License
HelloWorld
is defined as a function in the Example package, hence this test fails when all packages are loaded. Could you please rename it e.g. to helloworld
?
Line 12 in dbf0cc0
76.5 Structure of a GAP Package explains the directories structure of a GAP package. francy does not have PackageInfo.g
file in the top-level directory, but has it in its gap
subdirectory. GAPInfo.PackagesInfo
actually contains an entry for francy, what means that GAP detects that there is a PackageInfo.g in the subdirectory. This is however the first package of such kind, and I am afraid that this may cause confusion in many other places.
We discovered that Francy installs methods for SetSize
etc. and were wondering why. Looking closer, we discovered this code:
DeclareCategory("IsFrancyObject", IsObject);
...
DeclareCategory("IsShape", IsFrancyObject);
...
DeclareRepresentation("IsShapeRep", IsComponentObjectRep, [], IsShape);
...
DeclareAttribute("Size", IsShape);
InstallMethod(Size, "shape", [IsShape], o -> o!.size);
InstallMethod(SetSize, "shape, int", [IsShape, IsPosInt], function(o, i) o!.size := i; end);
This is quite puzzling to me, because it means that you are essentially reimplementing a core GAP feature: namely, attribute storing representations. As a matter of fact, if you remove your custom Size
and SetSize
methods, and replace IsComponentObjectRep
by IsAttributeStoringRep
, then you get almost identical code, except that o!.size
becomes o!.Size
.
Is there a reason you are not using IsAttributeStoringRep
? If not, I'd strongly suggest to switch to it, else you code will be a very non-gapish oddball, hard to understand and debug for people who are used to working with "standard" GAP objects. At the same time, you should be able to delete a ton of methods this way.
https://gap-packages.github.io/francy/doc/chap1.html has UNKNOWNEntity(JupyterKernel), UNKNOWNEntity(json), UNKNOWNEntity(Jupyter), etc.
From the CI logs:
jupyterlab-francy: $ jupyter labextension build .
jupyterlab-francy: Building extension in .
jupyterlab-francy: /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/jupyterlab/debuglog.py:56: UserWarning: An error occurred.
jupyterlab-francy: warnings.warn("An error occurred.")
jupyterlab-francy: /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/jupyterlab/debuglog.py:57: UserWarning: ValueError: Extensions require a devDependency on @jupyterlab/builder@^4.1.5, you have a dependency on 3.6.3
jupyterlab-francy: warnings.warn(msg[-1].strip())
On my Debian and Ubuntu systems the test file francy-1.2.4 /tst/canvas.tst
runs into an error at the command DrawSplash(canvas);
. The reason is that the corresponding method tries to open an HTML file in my standard browser with the command open
. But on my system /bin/open
is a link to openvt
, while I guess you want to call the program called xdg-open
which would open a local html-file in my preferred browser.
Unfortunately, I don't know if changing open
to xdg-open
in your code would work on most Linux systems.
Currently, I'm unable to get any graph node modal menus on the Jupyter notebook with a Python kernel. This regression happened after a development installation. Previously, I had them. I'll check again and add more details here.
Moreover on Jupyterlab, right clicking opens a specific Jupyterlab context menu. See jupyterlab/jupyterlab#3521
Travis should be configured in order to deploy the jupyter extension to pypi and create the github release.
After @sebasguts added Francy to the Docker container for the GAP master branch, package tests using that container all fail with the following:
Error, operation` ParentNode' was created as an attribute, use `DeclareAttribute'
See e.g. https://travis-ci.org/gap-system/gap-docker-pkg-tests-master/builds/392020023
Indeed, QPA does DeclareOperation( "ParentNode", [IsSuffixTreeNode] );
and Francy does DeclareAttribute("ParentNode", IsShape);
so it's not possible to load QPA after Francy. Could we resolve this in Francy as soon as possible please?
It seems there is a clash with GRAPE package.
Error, BIND_GLOBAL: variable `IsGraph' must be unbound at /home/pedro/lib/gap/lib/global.g:137 called from
BIND_GLOBAL( arg[1], CALL_FUNC_LIST( NewCategory, arg )
); at /home/pedro/lib/gap/lib/type.g:145 called from
<function "DeclareCategory">( <arguments> )
called from read-eval loop at /home/pedro/lib/gap/pkg/francy/gap/graph.gd:19
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>
Thanks,
Pedro
Hi Manuel
Do you think we could merge my francy-widget
into francy
as a subpackage?
If so, do you have specifications for me before I attempt a PR?
Best,
Use the singleton instead:
Might be used in other places...
On Mac OS X, I followed the instructions in the README file, with the following results.
$ pip install jupyter_francy
Got errors about insufficient permissions, because I set up my pip as root for some reason, so...
$ sudo pip install jupyter_francy
Did the whole installation, completing with this line of output:
Successfully installed jupyter-francy-0.8.10b0
Then this step failed, as shown:
$ jupyter nbextension enable --py --sys-prefix jupyter_francy
Traceback (most recent call last):
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/bin/jupyter-nbextension", line 11, in <module>
load_entry_point('notebook==5.0.0', 'console_scripts', 'jupyter-nbextension')()
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/vendor/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 900, in start
super(NBExtensionApp, self).start()
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/jupyter_core/application.py", line 256, in start
self.subapp.start()
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 808, in start
self.toggle_nbextension_python(self.extra_args[0])
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 784, in toggle_nbextension_python
logger=self.log)
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 445, in enable_nbextension_python
logger=logger)
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 360, in _set_nbextension_state_python
m, nbexts = _get_nbextension_metadata(module)
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/lib/python2.7/site-packages/notebook/nbextensions.py", line 1034, in _get_nbextension_metadata
m = import_item(module)
File "/usr/local/Cellar/jupyter/1.0.0_1/libexec/vendor/lib/python2.7/site-packages/traitlets/utils/importstring.py", line 42, in import_item
return __import__(parts[0])
ImportError: No module named jupyter_francy
Because pip list
does not mention jupyter_francy
, but rather jupyter-francy
, I also tried
$ jupyter nbextension enable --py --sys-prefix jupyter-francy
but that produced the same results (except with -
in place of _
of course).
What am I doing wrong?
The tests in the 2.0.0 release fail in canvas.tst, because the string returned by FrancyId(canvas)
does not match the expected value. The same is true for the id
field in the output of PrintObj(canvas)
. If I am reading the code correctly, the ID is a random uuid prepended with F
. This means that test is very nearly guaranteed to fail.
The JSON Schema is not used by the gap package, but contains the definition of the whole API and is the contract between Francy GAP and Francy JS (or any other that might come up)...
Hi again!
I'm trying to get a modal menu on graph nodes, on a python kernel.
Francy JS code (in francy-core/src/render/callback.js) calls a Trigger function, which does not exist in Python.
Did you think of any more general message handling feature?
It should be nice to have a way to minimize intersections of edges. This is interesting when drawing Hasse diagrams. Graphviz has this possibility, but with d3 this can be somehow difficult to achieve.
Thanks,
Pedro
Tracking issue for:
My own francy-widget
depends on francy
for all javascript and does not work on Jupyterlab: the browser does not seem to find the JS code, there is an error about not finding a file, although I can open the file from that same path.
I've been told that it comes from an incomplete javascript installation of francy.
I'll add more details later.
It should be possible to specify the renderer to use on GAP.
When a user specifies the renderer this way, the client should only allow the user to use the current renderer.
This bug is preventing the extension to work on lab: jupyterlab/jupyterlab#4599
Looking at the code, I noticed a few places that have dangling whitespace. It's probably a good idea to just clean those away, and then use a git-hook or your editor to clean them (or refuse commits if they exist).
There is a file release.txt
which says this:
This major release includes multiple bug fixes and performance improvements.
We dropped support to jupyter notebooks extension.
So it looks as if this meant to be a kind of NEWS or CHANGES file. But then it should at the very least indicate which version it refers to (I'd suggest to also include the date that release was made).
At the same time there is a file RELEASE.md
which despite its similar name seems to be totally unrelated, and serves as a reminder for @mcmartins . I would recommend to move that into a subdir dev
or etc
, and exclude it from the release tarball.
It is needed to implement proper tests on both modules. This should include code coverage and a travis build.
Hi Manuel!
I've been trying to install jupyter_francy in development mode, but the JS files do not seem to get built. I have tried following commands (from ./js/packages/francy-extension-jupyter):
$ pip install -vvv -e .
/.../
running egg_info
writing jupyter_francy.egg-info/PKG-INFO
writing dependency_links to jupyter_francy.egg-info/dependency_links.txt
writing requirements to jupyter_francy.egg-info/requires.txt
writing top-level names to jupyter_francy.egg-info/top_level.txt
reading manifest file 'jupyter_francy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'jupyter_francy/nbextension'
warning: no directories found matching 'jupyter_francy/labextension'
$ python setup.py egg_info
running egg_info
writing jupyter_francy.egg-info/PKG-INFO
writing dependency_links to jupyter_francy.egg-info/dependency_links.txt
writing requirements to jupyter_francy.egg-info/requires.txt
writing top-level names to jupyter_francy.egg-info/top_level.txt
reading manifest file 'jupyter_francy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no directories found matching 'jupyter_francy/nbextension'
warning: no directories found matching 'jupyter_francy/labextension'
writing manifest file 'jupyter_francy.egg-info/SOURCES.txt'
$ python setup.py sdist
-> no JS files at all in the resulting .tar.gz
XGap is too tightly coupled with the XWindow system making it difficult to reuse.
Francy should implement basic representation of canvas, shapes, groups, links and actions in the form of json. These features should output json-ld in order to allow any technology to build and display graphics.
By being able to use these objects, one will be able to use them and generate meaningful graphics for mathematical structures.
The francy 2.0.0 PackageInfo.g file indicates that the release archive is at https://github.com/gap-packages/francy/releases/download/v2.0.0/francy-2.0.0.tar.gz but that gives a 404 error. Indeed https://github.com/gap-packages/francy/releases/tag/v2.0.0 has no custom assets, only the auto-generated tarballs. Please do not use those for releases, as their checksums are not guaranteed to be stable -- while they are for now (there was a big kerfuffle about this some time ago), it is a bad practice anyway.
(If you were using ReleaseTools that would automatically take care of all that)
Hi Manuel,
I am implementing an interface for coco2p to francy and came upon a problem when removing messages using a callback. I attached a minimal example for the explanation:
It seems that francy is not always redrawing the screen when removing a message.
Best,
Christian
@mcmartins there are several PRs from dependabot - perhaps a time for a new release, to include into the forthcoming GAP release?
The website serves https://github.com/gap-packages/Francy/archive/v1.0.0.tar.gz - this is not a suitable name for a GAP package archive, as it does not contain the name of the package. Also, if you look at https://github.com/gap-packages/francy/releases then v1.0.0 is a tag but not a release. That's why I see now problems when trying to pick up francy:
* Francy - new version 1.0.0 discovered!!!
============================================
Getting new archives from
https://github.com/gap-packages/Francy/archive/v1.0.0[ ".tar.gz" ]
unpacking v1.0.0.tar.gz
#E component `HTMLStart' must be bound to a string denoting a relative path t\
o a readable file
#E component `PDFFile' must be bound to a string denoting a relative path to \
a readable file
#E component `SixFile' must be bound to a string denoting a relative path to \
a readable file
ERROR (Francy): validation of the info file not successful! SKIPPING!!!
Following instructions from
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.