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

Raw File Download
Permalink

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.

  • content
content badge Iframe embedding
swh:1:cnt:4e6ed161258b6b0c40de6c2a8d42eac82bd0ab3f
Citations

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.

  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
import os
import subprocess
import numpy

def ccvt_wrapper(num_points, random_seed=42):
    ccvtbin_path = os.path.join(os.path.dirname(__file__), 'ccvt_mod/build/ccvt')
    tempfile_sites = 'sites.txt'
    print(os.path.curdir,  os.path.exists(ccvtbin_path))
    assert os.path.exists(ccvtbin_path) or os.path.exists(ccvtbin_path + '.exe')
    if os.path.exists(tempfile_sites):
        os.remove(tempfile_sites)
    cmd_str = ccvtbin_path + " " + str(num_points) + " " + str(random_seed)
    print(subprocess.run(cmd_str, shell=True))
    points = []
    with open(tempfile_sites) as filesites:
    	lines = filesites.readlines()
    	for line in lines:
    		fields = line.strip('\n').split(' ')
    		if len(fields) == 2:
    			points.append(numpy.array([float(fields[0]), float(fields[1])]))
    
    assert len(points) == num_points
    return points


if __name__ == '__main__':
    import psa_wrapper
    num_samples = 100
    samples = []
    for sample in range(num_samples):
        points = ccvt_wrapper(num_points=512, random_seed=sample)
        samples.append(points)
    (effnyquist, oscillations, data_rp, data_ani, data_rdf) = psa_wrapper.psa_wrapper(samples)
    psa_wrapper.plot_data(data_ani, 'Frequency', 'Anisotropy', 'plot_ani')

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— Contact— JavaScript license information— Web API

back to top