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:32e96b0e1db6643f3f15144d7798e18f52b2da61
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 argparse
import multiprocessing
import os
import shutil
import subprocess
import sys
import sysconfig

import psutil


def main(input_dataset, output_diagram):
    from paraview import simple

    if "vtu" in input_dataset:
        ds = simple.XMLUnstructuredGridReader(FileName=[input_dataset])
    elif "vti" in input_dataset:
        ds = simple.XMLImageDataReader(FileName=[input_dataset])
    pd = simple.TTKFG_PersistentHomology(Input=ds)
    pd.ScalarField = "ImageFile_Order"
    simple.UpdatePipeline()
    shutil.move("/tmp/out.gudhi", output_diagram)


def set_env_and_run(thread_number):
    env = dict(os.environ)
    prefix = f"{os.getcwd()}/build_dirs/install_paraview_v5.6.1"
    env["PV_PLUGIN_PATH"] = f"{prefix}/lib/plugins"
    env["LD_LIBRARY_PATH"] = f"{prefix}/lib:" + os.environ.get("LD_LIBRARY_PATH", "")
    env["PYTHONPATH"] = ":".join(
        [
            f"{prefix}/lib/python{sysconfig.get_python_version()}/site-packages",
            f"{prefix}/lib",
        ]
    )
    env["OMP_NUM_THREADS"] = str(thread_number)

    subprocess.check_call([sys.executable] + sys.argv, env=env)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Compute diagram with PersistentCycles"
    )
    parser.add_argument("input_dataset", type=str, help="Input dataset")
    parser.add_argument(
        "-o", "--output_diagram", type=str, help="Output diagram", default="out.gudhi"
    )
    parser.add_argument(
        "-t",
        "--thread_number",
        type=int,
        help="Number of threads",
        default=multiprocessing.cpu_count(),
    )
    args = parser.parse_args()

    if psutil.Process().parent().cmdline()[1:] == sys.argv:
        main(args.input_dataset, args.output_diagram)
    else:
        set_env_and_run(args.thread_number)

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