How to use the gudhi.PeriodicCubicalComplex function in gudhi

To help you get started, we’ve selected a few gudhi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GUDHI / gudhi-devel / src / python / example / periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py View on Github external
)

parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument(
    "--no-barcode",
    default=False,
    action="store_true",
    help="Flag for not to display the barcodes",
)

args = parser.parse_args()

if is_file_perseus(args.file):
    print("#####################################################################")
    print("PeriodicCubicalComplex creation")
    periodic_cubical_complex = gudhi.PeriodicCubicalComplex(perseus_file=args.file)

    print("persistence(homology_coeff_field=3, min_persistence=0)=")
    diag = periodic_cubical_complex.persistence(
        homology_coeff_field=3, min_persistence=0
    )
    print(diag)

    print("betti_numbers()=")
    print(periodic_cubical_complex.betti_numbers())
    if args.no_barcode == False:
        gudhi.plot_persistence_barcode(diag)
        plot.show()
else:
    print(args.file, "is not a valid perseus style file")
github GUDHI / gudhi-devel / src / cython / doc / pyplots / barcode_persistence.py View on Github external
import gudhi

periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file='../3d_torus.txt')
diag = periodic_cc.persistence()
gudhi.plot_persistence_barcode(diag)