Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/uberparagon/mgn
22 June 2021, 16:13:34 UTC
  • Code
  • Branches (5)
  • Releases (0)
  • Visits
Revision 82473138c0a848ce4a690d78346e3b6888c6f253 authored by Drew Johnson on 08 September 2017, 20:36:56 UTC, committed by Drew Johnson on 08 September 2017, 20:36:56 UTC
fixing links more
1 parent cc8e411
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/1.1.2
    • refs/tags/v1.0.4
    • refs/tags/v1.0.5
    • refs/tags/v1.0.9
    • 82473138c0a848ce4a690d78346e3b6888c6f253
    No releases to show
  • 7ed3cb3
  • /
  • topintersections
  • /
  • checkin.py
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:82473138c0a848ce4a690d78346e3b6888c6f253
origin badgedirectory badge
swh:1:dir:0ee13de883b3f9ba9f2fe1f9f220933c949ba17c
origin badgecontent badge
swh:1:cnt:f62837c1b206ef406d502f2fc2538d5a2be10cbf
origin badgesnapshot badge
swh:1:snp:6e9d4128140ea9fc091a9d1ff362de9d8be50de2

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 82473138c0a848ce4a690d78346e3b6888c6f253 authored by Drew Johnson on 08 September 2017, 20:36:56 UTC
fixing links more
Tip revision: 8247313
checkin.py
"""
This is very useful for debugging recursive programs.  It is not a part of the intersection theory code.
"""


level = 0
def checkin(func):    
    def checkin_func(*args):
        global level
        print "." * level + "Entering {0} with arguments {1}".format(func.__name__, args)
        level += 1
        value = func(*args)
        level -= 1
        print "." * level + "Exiting {0} with arguments {1}, returning value {2}".format(func.__name__, args, value)
        
        return value
    return checkin_func

    
    
    
    
    
class Node:
    def __init__(self, data, parent = None, func = "unknown"):
        self.children = []
        self.data =  str(data)
        self.real_data = data
        self.parent = parent
        self.value = None
        self.func = func
        self.flag = ""
        
    def add_child(self, data, func="unknown"):
        child = Node(data, self,func)
        self.children.append(child)
        return child
        
    def make_big_maple_code(self, filename):
        with open(filename, "w") as f:
            f.write("read MgnF;")
            for c in self.children:
                f.write(c.maple_code() + "\n")
                
    def maple_code(self):
        M = self.data[0][0]
        m = self.data[1]
        expon_list = []
        for l in ([M.num(d)]*expon for d, expon in m.decompose_monomial()):
            expon_list += l
        return "mgn(" + str(M.genus) + ", "+ str( expon_list )  + ");\n"
        
    def __str__(self):
        _str = repr(self) 
        for c,i in zip(self.children, range(len(self.children))):
            _str += "\n[{0}] ".format(i) + repr(c)
        return _str
        
    def inFaberNotation(self): #not done yet!
        _str = repr(self) 
        for c,i in zip(self.children, range(len(self.children))):
            _str += "\n[{0}] ".format(i) + repr(c)
        return _str
        
    def __repr__(self):
        return self.func + " " + str(self.data) + " = " + str(self.value) + " " + self.flag
        
    def __getitem__(self,i):
        return self.children[i]
        
    def mark_ancestors(self, message):
        if self.parent != None:
            self.parent.flag += ", " +  message
            self.parent.mark_ancestors(message)

        
def cireset():
    global root, current, level
    root = Node("root")
    current = root
    level = 0
cireset()

def breadth_first_tree(func):
    def bft(*args):
        global root, current, level
        #print "." * level + "Entering {0} with arguments {1}".format(func.__name__, args)
        level += 1
        current = current.add_child(args, func.__name__)
        value = func(*args)
        current.value = value
        current = current.parent        
        level -= 1
        #print "." * level + "Exiting {0} with arguments {1}, returning value {2}".format(func.__name__, args, value)
        return value
        
    return bft
        
fabers_dir = "/home/drew/Dropbox/fabers maple code/Send10/"
    
from sage.all import *
maple('currentdir("{0}")'.format(fabers_dir))
maple.eval('read "MgnLb.txt"')
print "Loaded MgnLb."

def breadth_first_tree_MgnLb(func):
    def bft(*args):
        global root, current, level
        #print "." * level + "Entering {0} with arguments {1}".format(func.__name__, args)
        level += 1
        current = current.add_child(args, func.__name__)
        
        g= args[0].space.genus
        n= args[0].space.n
        c= args[0].get_MgnLb_indexes()
        mapleans = maple("mgn({0}, {1}, {2})".format(g, n, c))
        value = func(*args)
        if mapleans != value:
            current.flag = "wrong... should be " + str(c) + " = " + str(mapleans)
            current.mark_ancestors("bad child")
        current.value = value
        current = current.parent        
        level -= 1
        #print "." * level + "Exiting {0} with arguments {1}, returning value {2}".format(func.__name__, args, value)
        return value
        
    return bft
        

        
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API