Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I've published a small library of code that people can easily use just by loading it. I tried to make the library so that it can also be downloaded into a directory and imported as a normal python module. See https://github.com/jasongrout/minimum_rank for my code. To load the code into a Sage worksheet or session, I just include

%auto # make sure to evaluate this cell to load the functions 
URL='http://github.com/jasongrout/minimum_rank/raw/minimum_rank_1_0_0/' 
files=['Zq_c.pyx','Zq.py','zero_forcing_64.pyx','zero_forcing_wavefront.pyx','minrank.py']
for f in files: load(URL+f)

in the top cell (note that this loads the files straight from the github page). This will automatically compile the Cython files as well. This can be done, but the entire directory could also be downloaded and used by just importing the module into the namespace. A third way I distribute this library is by attaching the files to a Sage worksheet, and then loading the files using the DATA path instead of the github path above.

I've published a small library of code that people can easily use just by loading it. I tried to make the library so that it can also be downloaded into a directory and imported as a normal python module. See https://github.com/jasongrout/minimum_rank for my code. To load the code into a Sage worksheet or session, I just include

%auto # make sure to evaluate this cell to load the functions 
URL='http://github.com/jasongrout/minimum_rank/raw/minimum_rank_1_0_0/' 
files=['Zq_c.pyx','Zq.py','zero_forcing_64.pyx','zero_forcing_wavefront.pyx','minrank.py']
for f in files: load(URL+f)

in the top cell (note that this loads the files straight from the github page). This will automatically compile the Cython files as well. This can be done, but the entire directory could also be downloaded and used by just importing the module into the namespace. A third way I distribute this library is by attaching the files to a Sage worksheet, and then loading the files using the DATA path instead of the github path above.

I've published a small library of code that people can easily use just by loading it. I tried to make the library so that it can also be downloaded into a directory and imported as a normal python module. See https://github.com/jasongrout/minimum_rank for my code. To load the code into a Sage worksheet or session, I just include

URL='http://github.com/jasongrout/minimum_rank/raw/minimum_rank_1_0_0/' 
files=['Zq_c.pyx','Zq.py','zero_forcing_64.pyx','zero_forcing_wavefront.pyx','minrank.py']
for f in files: load(URL+f)

in the top cell (note that this loads the files straight from the github page). This will automatically compile the Cython files as well. This can be done, but the entire directory could also be downloaded and used by just importing the module into the namespace. A third way I distribute this library is by attaching the files to a Sage worksheet, and then loading the files using the DATA path instead of the github path above.

My purpose in doing this is that many of the people in my target audience will not have the ability to install spkgs (for example, on sagenb.org). This approach allows them to use the library by just including a few lines at the top of their worksheet.