USGSCSM
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

AutoCNET graph object (io.io_autocnetgraph)

Reading/Writing the Graph Object

New in version 0.1.1.

class plio.io.io_autocnetgraph.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]
default(obj)[source]

If input object is an ndarray it will be converted into a dict holding dtype, shape and the data, base64 encoded.

plio.io.io_autocnetgraph.load(projectname)[source]

Read an AutoCNET project into memory.

Parameters:

projectname (str) – PATH to the project

Returns:

cg – AutoCNET CandidateGraph object

Return type:

object

plio.io.io_autocnetgraph.save(network, projectname)[source]

Save an AutoCNet candiate graph to disk in a compressed file. The graph adjacency structure is stored as human readable JSON and all potentially large numpy arrays are stored as compressed binary. The project archive is a standard .zip file that can have any ending, e.g., <projectname>.project, <projectname>.zip, <projectname>.myname.

TODO: This func. writes a intermediary .npz to disk when saving. Can we write the .npz to memory?

Parameters:
  • network (object) – The AutoCNet Candidate Graph object

  • projectname (str) – The PATH to the output file.