diff --git a/.buildinfo b/.buildinfo index d86f242..5fec09a 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 9959f9f77852bed4e0895d1c80d740c2 +config: 00e1adf756fe464b3e946f1ef4f606a0 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.doctrees/autoapi/index.doctree b/.doctrees/autoapi/index.doctree index f308460..e5104b2 100644 Binary files a/.doctrees/autoapi/index.doctree and b/.doctrees/autoapi/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/__about__/index.doctree b/.doctrees/autoapi/pyorderly/__about__/index.doctree new file mode 100644 index 0000000..0ceb811 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/__about__/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/core/index.doctree b/.doctrees/autoapi/pyorderly/core/index.doctree new file mode 100644 index 0000000..eab7048 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/core/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/current/index.doctree b/.doctrees/autoapi/pyorderly/current/index.doctree new file mode 100644 index 0000000..e1672d9 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/current/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/index.doctree b/.doctrees/autoapi/pyorderly/index.doctree new file mode 100644 index 0000000..c5a799b Binary files /dev/null and b/.doctrees/autoapi/pyorderly/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/config/index.doctree b/.doctrees/autoapi/pyorderly/outpack/config/index.doctree new file mode 100644 index 0000000..006222d Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/config/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/copy_files/index.doctree b/.doctrees/autoapi/pyorderly/outpack/copy_files/index.doctree new file mode 100644 index 0000000..3c56d04 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/copy_files/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/filestore/index.doctree b/.doctrees/autoapi/pyorderly/outpack/filestore/index.doctree new file mode 100644 index 0000000..364a2db Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/filestore/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/hash/index.doctree b/.doctrees/autoapi/pyorderly/outpack/hash/index.doctree new file mode 100644 index 0000000..43adef5 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/hash/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/ids/index.doctree b/.doctrees/autoapi/pyorderly/outpack/ids/index.doctree new file mode 100644 index 0000000..67fff3a Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/ids/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/index.doctree b/.doctrees/autoapi/pyorderly/outpack/index.doctree new file mode 100644 index 0000000..14757b2 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/index/index.doctree b/.doctrees/autoapi/pyorderly/outpack/index/index.doctree new file mode 100644 index 0000000..977c430 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/index/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/init/index.doctree b/.doctrees/autoapi/pyorderly/outpack/init/index.doctree new file mode 100644 index 0000000..3697fd4 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/init/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/location/index.doctree b/.doctrees/autoapi/pyorderly/outpack/location/index.doctree new file mode 100644 index 0000000..ec72a1e Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/location/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/location_driver/index.doctree b/.doctrees/autoapi/pyorderly/outpack/location_driver/index.doctree new file mode 100644 index 0000000..50f5b15 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/location_driver/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/location_path/index.doctree b/.doctrees/autoapi/pyorderly/outpack/location_path/index.doctree new file mode 100644 index 0000000..75a2631 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/location_path/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/location_pull/index.doctree b/.doctrees/autoapi/pyorderly/outpack/location_pull/index.doctree new file mode 100644 index 0000000..ded8061 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/location_pull/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/location_ssh/index.doctree b/.doctrees/autoapi/pyorderly/outpack/location_ssh/index.doctree new file mode 100644 index 0000000..d6d9b85 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/location_ssh/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/metadata/index.doctree b/.doctrees/autoapi/pyorderly/outpack/metadata/index.doctree new file mode 100644 index 0000000..732caa5 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/metadata/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/packet/index.doctree b/.doctrees/autoapi/pyorderly/outpack/packet/index.doctree new file mode 100644 index 0000000..8bea837 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/packet/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/root/index.doctree b/.doctrees/autoapi/pyorderly/outpack/root/index.doctree new file mode 100644 index 0000000..ad1fdcf Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/root/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/sandbox/index.doctree b/.doctrees/autoapi/pyorderly/outpack/sandbox/index.doctree new file mode 100644 index 0000000..dca85a9 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/sandbox/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/schema/index.doctree b/.doctrees/autoapi/pyorderly/outpack/schema/index.doctree new file mode 100644 index 0000000..2f7a878 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/schema/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/search/index.doctree b/.doctrees/autoapi/pyorderly/outpack/search/index.doctree new file mode 100644 index 0000000..52f6ced Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/search/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/search_options/index.doctree b/.doctrees/autoapi/pyorderly/outpack/search_options/index.doctree new file mode 100644 index 0000000..4817f81 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/search_options/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/static/index.doctree b/.doctrees/autoapi/pyorderly/outpack/static/index.doctree new file mode 100644 index 0000000..da4eb1b Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/static/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/tools/index.doctree b/.doctrees/autoapi/pyorderly/outpack/tools/index.doctree new file mode 100644 index 0000000..30a3060 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/tools/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/outpack/util/index.doctree b/.doctrees/autoapi/pyorderly/outpack/util/index.doctree new file mode 100644 index 0000000..245923d Binary files /dev/null and b/.doctrees/autoapi/pyorderly/outpack/util/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/read/index.doctree b/.doctrees/autoapi/pyorderly/read/index.doctree new file mode 100644 index 0000000..1e1cb24 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/read/index.doctree differ diff --git a/.doctrees/autoapi/pyorderly/run/index.doctree b/.doctrees/autoapi/pyorderly/run/index.doctree new file mode 100644 index 0000000..26d4e48 Binary files /dev/null and b/.doctrees/autoapi/pyorderly/run/index.doctree differ diff --git a/.doctrees/code.doctree b/.doctrees/code.doctree index a4a144f..49aae4e 100644 Binary files a/.doctrees/code.doctree and b/.doctrees/code.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index e68372b..68a3886 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/index.doctree b/.doctrees/index.doctree index 18c4000..957f5ba 100644 Binary files a/.doctrees/index.doctree and b/.doctrees/index.doctree differ diff --git a/.doctrees/readme.doctree b/.doctrees/readme.doctree index 2aca036..dd785fa 100644 Binary files a/.doctrees/readme.doctree and b/.doctrees/readme.doctree differ diff --git a/_sources/autoapi/index.rst.txt b/_sources/autoapi/index.rst.txt index 01dde62..8abd216 100644 --- a/_sources/autoapi/index.rst.txt +++ b/_sources/autoapi/index.rst.txt @@ -6,7 +6,6 @@ This page contains auto-generated API reference documentation [#f1]_. .. toctree:: :titlesonly: - /autoapi/orderly/index - /autoapi/outpack/index + /autoapi/pyorderly/index .. [#f1] Created with `sphinx-autoapi `_ \ No newline at end of file diff --git a/_sources/autoapi/pyorderly/__about__/index.rst.txt b/_sources/autoapi/pyorderly/__about__/index.rst.txt new file mode 100644 index 0000000..aef2f8d --- /dev/null +++ b/_sources/autoapi/pyorderly/__about__/index.rst.txt @@ -0,0 +1,26 @@ +pyorderly.__about__ +=================== + +.. py:module:: pyorderly.__about__ + + +Attributes +---------- + +.. autoapisummary:: + + pyorderly.__about__.__version__ + pyorderly.__about__.__name__ + + +Module Contents +--------------- + +.. py:data:: __version__ + :value: '0.0.1' + + +.. py:data:: __name__ + :value: 'pyorderly' + + diff --git a/_sources/autoapi/pyorderly/core/index.rst.txt b/_sources/autoapi/pyorderly/core/index.rst.txt new file mode 100644 index 0000000..29258e7 --- /dev/null +++ b/_sources/autoapi/pyorderly/core/index.rst.txt @@ -0,0 +1,212 @@ +pyorderly.core +============== + +.. py:module:: pyorderly.core + + +Classes +------- + +.. autoapisummary:: + + pyorderly.core.Artefact + pyorderly.core.Description + pyorderly.core.Parameters + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.core.parameters + pyorderly.core.resource + pyorderly.core.shared_resource + pyorderly.core.artefact + pyorderly.core.description + pyorderly.core.dependency + + +Module Contents +--------------- + +.. py:class:: Artefact + + .. py:attribute:: name + :type: str + + + .. py:attribute:: files + :type: List[str] + + +.. py:class:: Description + + .. py:attribute:: display + :type: str + + + .. py:attribute:: long + :type: str + + + .. py:attribute:: custom + :type: Dict[str, Union[str, int, bool]] + + + .. py:method:: empty() + :staticmethod: + + + +.. py:class:: Parameters + + Bases: :py:obj:`types.SimpleNamespace` + + + A container for parameters used in a report. + + An instance of this class is returned by the `orderly.parameters` function. + Individual parameters can be accessed as fields of the object. + + Example: + + >>> params = orderly.parameters(p=1) + >>> params.p + 1 + + +.. py:function:: parameters(**kwargs) -> Parameters + + Declare parameters used in a report. + + Parameters + ---------- + kwargs : + Keyword mappings of parameter names to default values (or to None + if no default is given) + + Returns + ------- + The parameters that were passed to the report. If running outside of an + orderly context, this returns kwargs unmodified. + + +.. py:function:: resource(files) + + Declare that a file, or group of files, are an orderly resource. + + By explicitly declaring files as resources, orderly will mark the + files as immutable inputs and validate that your analysis does not + modify them with 'orderly.run'. + + Parameters + ---------- + files : str|Path or [str|Path] + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + + +.. py:function:: shared_resource(files: Union[str, List[str], Dict[str, str]]) -> Dict[str, str] + + Copy shared resources into a packet directory. + + You can use this to share common resources (data or code) between multiple + packets. Additional metadata will be added to keep track of where the files + came from. Using this function requires the shared resources directory + `shared/` exists at the orderly root; an error will be + raised if this is not configured when we attempt to fetch files. + + Parameters + ---------- + files: str | [str] | dict[str, str] + The shared resources to copy. If a dictionary is provided, the keys will + be the destination file while the value is the filename within the + shared resource directory. + + Returns + ------- + A dictionary of files that were copied. If a directory was copied, this + includes all of its individual contents. Do not rely on the ordering + where directory expansion was performed, as it may be platform + dependent. + + +.. py:function:: artefact(name, files) + + Declare an artefact. + + By doing this you turn on a number of orderly features: + + (1) Files that are artefacts will not be copied from the src + directory into the draft directory unless they are also listed as + a resource by 'orderly.resource' + + (2) If your script fails to produce these files, then + `orderly.run` will fail, guaranteeing that your task really does + produce the things you need it do. + + (3) Within the final metadata, your artefacts will have additional + metadata; the description that you provide and a grouping. + + Parameters + ---------- + description : str + The name of the artefact + + files : str or [str] + The file, or array of files, that make up this artefact. These + are relative paths. + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + +.. py:function:: description(*, display=None, long=None, custom=None) + + Describe the current report. + + Parameters + ---------- + display : str + A friendly name for the report; this will be displayed in some + locations of the web interfaces, packit. + + long : str + A longer description, perhaps a sentence or two. + + custom : dict + Any additional metadata. Must be a dictionary with string keys + and string, number or boolean values. + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + +.. py:function:: dependency(name, query, files) + + Declare a dependency on another packet. + + Parameters + ---------- + name: str | None + The name of the packet to depend on, or None + + query: str + A search query for packets, as a string. For example, "latest", + "latest(parameter:x == 'value')" or "20230807-152344-ee606dce" + + files: str | [str] | dict[str, str] + Files to use from the dependent packet + + Returns + ------- + Data on the resolved dependency; this is an `orderly.helpers.Plan` object, + which contains elements `id`, `name` and `files` + + diff --git a/_sources/autoapi/pyorderly/current/index.rst.txt b/_sources/autoapi/pyorderly/current/index.rst.txt new file mode 100644 index 0000000..cac6e7a --- /dev/null +++ b/_sources/autoapi/pyorderly/current/index.rst.txt @@ -0,0 +1,112 @@ +pyorderly.current +================= + +.. py:module:: pyorderly.current + + +Classes +------- + +.. autoapisummary:: + + pyorderly.current.OrderlyCustomMetadata + pyorderly.current.OrderlyContext + pyorderly.current.ActiveOrderlyContext + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.current.get_active_context + pyorderly.current.detect_orderly_interactive_root + + +Module Contents +--------------- + +.. py:class:: OrderlyCustomMetadata + + .. py:attribute:: resources + :value: [] + + + + .. py:attribute:: shared_resources + + + .. py:attribute:: artefacts + :value: [] + + + + .. py:attribute:: description + :value: None + + + +.. py:class:: OrderlyContext + + .. py:attribute:: packet + :type: Optional[pyorderly.outpack.packet.Packet] + + + .. py:attribute:: path + :type: pathlib.Path + + + .. py:attribute:: path_src + :type: pathlib.Path + + + .. py:attribute:: root + :type: pyorderly.outpack.root.OutpackRoot + + + .. py:attribute:: parameters + :type: dict + + + .. py:attribute:: name + :type: str + + + .. py:attribute:: orderly + :type: OrderlyCustomMetadata + + + .. py:attribute:: search_options + :type: Optional[pyorderly.outpack.search_options.SearchOptions] + + + .. py:method:: from_packet(packet, path_src, search_options=None) + :staticmethod: + + + + .. py:method:: interactive() + :staticmethod: + + + + .. py:property:: is_active + + +.. py:class:: ActiveOrderlyContext(*args, **kwargs) + + .. py:method:: __enter__() + + + .. py:method:: __exit__(exc_type, exc_value, exc_tb) + + + .. py:method:: current() + :staticmethod: + + + +.. py:function:: get_active_context() + +.. py:function:: detect_orderly_interactive_root(path) + diff --git a/_sources/autoapi/pyorderly/index.rst.txt b/_sources/autoapi/pyorderly/index.rst.txt new file mode 100644 index 0000000..58c03ce --- /dev/null +++ b/_sources/autoapi/pyorderly/index.rst.txt @@ -0,0 +1,203 @@ +pyorderly +========= + +.. py:module:: pyorderly + + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + /autoapi/pyorderly/outpack/index + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /autoapi/pyorderly/__about__/index + /autoapi/pyorderly/core/index + /autoapi/pyorderly/current/index + /autoapi/pyorderly/read/index + /autoapi/pyorderly/run/index + + +Classes +------- + +.. autoapisummary:: + + pyorderly.Parameters + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.artefact + pyorderly.dependency + pyorderly.description + pyorderly.parameters + pyorderly.resource + pyorderly.shared_resource + + +Package Contents +---------------- + +.. py:class:: Parameters + + Bases: :py:obj:`types.SimpleNamespace` + + + A container for parameters used in a report. + + An instance of this class is returned by the `orderly.parameters` function. + Individual parameters can be accessed as fields of the object. + + Example: + + >>> params = orderly.parameters(p=1) + >>> params.p + 1 + + +.. py:function:: artefact(name, files) + + Declare an artefact. + + By doing this you turn on a number of orderly features: + + (1) Files that are artefacts will not be copied from the src + directory into the draft directory unless they are also listed as + a resource by 'orderly.resource' + + (2) If your script fails to produce these files, then + `orderly.run` will fail, guaranteeing that your task really does + produce the things you need it do. + + (3) Within the final metadata, your artefacts will have additional + metadata; the description that you provide and a grouping. + + Parameters + ---------- + description : str + The name of the artefact + + files : str or [str] + The file, or array of files, that make up this artefact. These + are relative paths. + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + +.. py:function:: dependency(name, query, files) + + Declare a dependency on another packet. + + Parameters + ---------- + name: str | None + The name of the packet to depend on, or None + + query: str + A search query for packets, as a string. For example, "latest", + "latest(parameter:x == 'value')" or "20230807-152344-ee606dce" + + files: str | [str] | dict[str, str] + Files to use from the dependent packet + + Returns + ------- + Data on the resolved dependency; this is an `orderly.helpers.Plan` object, + which contains elements `id`, `name` and `files` + + +.. py:function:: description(*, display=None, long=None, custom=None) + + Describe the current report. + + Parameters + ---------- + display : str + A friendly name for the report; this will be displayed in some + locations of the web interfaces, packit. + + long : str + A longer description, perhaps a sentence or two. + + custom : dict + Any additional metadata. Must be a dictionary with string keys + and string, number or boolean values. + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + +.. py:function:: parameters(**kwargs) -> Parameters + + Declare parameters used in a report. + + Parameters + ---------- + kwargs : + Keyword mappings of parameter names to default values (or to None + if no default is given) + + Returns + ------- + The parameters that were passed to the report. If running outside of an + orderly context, this returns kwargs unmodified. + + +.. py:function:: resource(files) + + Declare that a file, or group of files, are an orderly resource. + + By explicitly declaring files as resources, orderly will mark the + files as immutable inputs and validate that your analysis does not + modify them with 'orderly.run'. + + Parameters + ---------- + files : str|Path or [str|Path] + + Returns + ------- + Nothing, this is called for its side effects within a running packet + + + +.. py:function:: shared_resource(files: Union[str, List[str], Dict[str, str]]) -> Dict[str, str] + + Copy shared resources into a packet directory. + + You can use this to share common resources (data or code) between multiple + packets. Additional metadata will be added to keep track of where the files + came from. Using this function requires the shared resources directory + `shared/` exists at the orderly root; an error will be + raised if this is not configured when we attempt to fetch files. + + Parameters + ---------- + files: str | [str] | dict[str, str] + The shared resources to copy. If a dictionary is provided, the keys will + be the destination file while the value is the filename within the + shared resource directory. + + Returns + ------- + A dictionary of files that were copied. If a directory was copied, this + includes all of its individual contents. Do not rely on the ordering + where directory expansion was performed, as it may be platform + dependent. + + diff --git a/_sources/autoapi/pyorderly/outpack/config/index.rst.txt b/_sources/autoapi/pyorderly/outpack/config/index.rst.txt new file mode 100644 index 0000000..f119b9d --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/config/index.rst.txt @@ -0,0 +1,97 @@ +pyorderly.outpack.config +======================== + +.. py:module:: pyorderly.outpack.config + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.config.ConfigCore + pyorderly.outpack.config.Location + pyorderly.outpack.config.Config + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.config.read_config + pyorderly.outpack.config.write_config + pyorderly.outpack.config.update_config + + +Module Contents +--------------- + +.. py:function:: read_config(root_path) + +.. py:function:: write_config(config, root_path) + +.. py:function:: update_config(config, root_path) + +.. py:class:: ConfigCore + + .. py:attribute:: hash_algorithm + :type: str + + + .. py:attribute:: path_archive + :type: Optional[str] + + + .. py:attribute:: use_file_store + :type: bool + + + .. py:attribute:: require_complete_tree + :type: bool + + +.. py:class:: Location(name, type, args=None) + + .. py:attribute:: name + :type: str + + + .. py:attribute:: type + :type: str + + + .. py:attribute:: args + :type: Optional[dict] + :value: None + + + + .. py:attribute:: required + + + .. py:attribute:: present + + + .. py:attribute:: missing + + +.. py:class:: Config + + .. py:attribute:: schema_version + :type: str + + + .. py:attribute:: core + :type: ConfigCore + + + .. py:attribute:: location + :type: Dict[str, Location] + + + .. py:method:: new(*, path_archive='archive', use_file_store=False, require_complete_tree=False) + :staticmethod: + + + diff --git a/_sources/autoapi/pyorderly/outpack/copy_files/index.rst.txt b/_sources/autoapi/pyorderly/outpack/copy_files/index.rst.txt new file mode 100644 index 0000000..a35a651 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/copy_files/index.rst.txt @@ -0,0 +1,44 @@ +pyorderly.outpack.copy_files +============================ + +.. py:module:: pyorderly.outpack.copy_files + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.copy_files.Plan + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.copy_files.copy_files + pyorderly.outpack.copy_files.copy_files_from_remote + + +Module Contents +--------------- + +.. py:class:: Plan + + .. py:attribute:: id + :type: str + + + .. py:attribute:: name + :type: str + + + .. py:attribute:: files + :type: Dict[str, pyorderly.outpack.metadata.PacketFile] + + +.. py:function:: copy_files(id: str, files: Dict[str, str], dest: pathlib.Path, options: pyorderly.outpack.search_options.SearchOptions, root: pyorderly.outpack.root.OutpackRoot) -> Plan + +.. py:function:: copy_files_from_remote(id: str, files: Dict[str, pyorderly.outpack.metadata.PacketFile], dest: pathlib.Path, options: pyorderly.outpack.search_options.SearchOptions, root: pyorderly.outpack.root.OutpackRoot) + diff --git a/_sources/autoapi/pyorderly/outpack/filestore/index.rst.txt b/_sources/autoapi/pyorderly/outpack/filestore/index.rst.txt new file mode 100644 index 0000000..197040c --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/filestore/index.rst.txt @@ -0,0 +1,40 @@ +pyorderly.outpack.filestore +=========================== + +.. py:module:: pyorderly.outpack.filestore + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.filestore.FileStore + + +Module Contents +--------------- + +.. py:class:: FileStore(path) + + .. py:method:: filename(hash) + + + .. py:method:: get(hash, dst, *, overwrite=False) + + + .. py:method:: exists(hash) + + + .. py:method:: put(src, hash, *, move=False) + + + .. py:method:: ls() + + + .. py:method:: destroy() -> None + + + .. py:method:: tmp() + + diff --git a/_sources/autoapi/pyorderly/outpack/hash/index.rst.txt b/_sources/autoapi/pyorderly/outpack/hash/index.rst.txt new file mode 100644 index 0000000..b66dca6 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/hash/index.rst.txt @@ -0,0 +1,58 @@ +pyorderly.outpack.hash +====================== + +.. py:module:: pyorderly.outpack.hash + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.hash.Hash + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.hash.hash_file + pyorderly.outpack.hash.hash_string + pyorderly.outpack.hash.hash_parse + pyorderly.outpack.hash.hash_validate + pyorderly.outpack.hash.hash_validate_file + pyorderly.outpack.hash.hash_validate_string + + +Module Contents +--------------- + +.. py:class:: Hash + + .. py:attribute:: algorithm + :type: str + + + .. py:attribute:: value + :type: str + + + .. py:method:: __str__() + + Return str(self). + + + +.. py:function:: hash_file(path, algorithm='sha256') + +.. py:function:: hash_string(data, algorithm) + +.. py:function:: hash_parse(string) + +.. py:function:: hash_validate(found, expected, name, body=None) + +.. py:function:: hash_validate_file(path, expected, body=None) + +.. py:function:: hash_validate_string(data, expected, name, body=None) + diff --git a/_sources/autoapi/pyorderly/outpack/ids/index.rst.txt b/_sources/autoapi/pyorderly/outpack/ids/index.rst.txt new file mode 100644 index 0000000..bdc70a9 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/ids/index.rst.txt @@ -0,0 +1,38 @@ +pyorderly.outpack.ids +===================== + +.. py:module:: pyorderly.outpack.ids + + +Attributes +---------- + +.. autoapisummary:: + + pyorderly.outpack.ids.RE_ID + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.ids.fractional_to_bytes + pyorderly.outpack.ids.outpack_id + pyorderly.outpack.ids.is_outpack_id + pyorderly.outpack.ids.validate_outpack_id + + +Module Contents +--------------- + +.. py:data:: RE_ID + +.. py:function:: fractional_to_bytes(x) + +.. py:function:: outpack_id() + +.. py:function:: is_outpack_id(x: str) + +.. py:function:: validate_outpack_id(x: str) + diff --git a/_sources/autoapi/pyorderly/outpack/index.rst.txt b/_sources/autoapi/pyorderly/outpack/index.rst.txt new file mode 100644 index 0000000..3b2bc57 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/index.rst.txt @@ -0,0 +1,44 @@ +pyorderly.outpack +================= + +.. py:module:: pyorderly.outpack + + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + /autoapi/pyorderly/outpack/schema/index + + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + /autoapi/pyorderly/outpack/config/index + /autoapi/pyorderly/outpack/copy_files/index + /autoapi/pyorderly/outpack/filestore/index + /autoapi/pyorderly/outpack/hash/index + /autoapi/pyorderly/outpack/ids/index + /autoapi/pyorderly/outpack/index/index + /autoapi/pyorderly/outpack/init/index + /autoapi/pyorderly/outpack/location/index + /autoapi/pyorderly/outpack/location_driver/index + /autoapi/pyorderly/outpack/location_path/index + /autoapi/pyorderly/outpack/location_pull/index + /autoapi/pyorderly/outpack/location_ssh/index + /autoapi/pyorderly/outpack/metadata/index + /autoapi/pyorderly/outpack/packet/index + /autoapi/pyorderly/outpack/root/index + /autoapi/pyorderly/outpack/sandbox/index + /autoapi/pyorderly/outpack/search/index + /autoapi/pyorderly/outpack/search_options/index + /autoapi/pyorderly/outpack/static/index + /autoapi/pyorderly/outpack/tools/index + /autoapi/pyorderly/outpack/util/index + + diff --git a/_sources/autoapi/pyorderly/outpack/index/index.rst.txt b/_sources/autoapi/pyorderly/outpack/index/index.rst.txt new file mode 100644 index 0000000..13543d2 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/index/index.rst.txt @@ -0,0 +1,66 @@ +pyorderly.outpack.index +======================= + +.. py:module:: pyorderly.outpack.index + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.index.IndexData + pyorderly.outpack.index.Index + + +Module Contents +--------------- + +.. py:class:: IndexData + + .. py:attribute:: metadata + :type: Dict[str, pyorderly.outpack.metadata.MetadataCore] + + + .. py:attribute:: location + :type: Dict[str, Dict[str, pyorderly.outpack.metadata.PacketLocation]] + + + .. py:attribute:: unpacked + :type: List[str] + + + .. py:method:: new() + :staticmethod: + + + +.. py:class:: Index(path) + + .. py:attribute:: data + + + .. py:method:: rebuild() + + + .. py:method:: refresh() + + + .. py:method:: all_metadata() -> Dict[str, pyorderly.outpack.metadata.MetadataCore] + + + .. py:method:: metadata(id) -> pyorderly.outpack.metadata.MetadataCore + + + .. py:method:: all_locations() -> Dict[str, Dict[str, pyorderly.outpack.metadata.PacketLocation]] + + + .. py:method:: location(name) -> Dict[str, pyorderly.outpack.metadata.PacketLocation] + + + .. py:method:: packets_in_location(name) -> List[str] + + + .. py:method:: unpacked() -> List[str] + + diff --git a/_sources/autoapi/pyorderly/outpack/init/index.rst.txt b/_sources/autoapi/pyorderly/outpack/init/index.rst.txt new file mode 100644 index 0000000..04295d4 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/init/index.rst.txt @@ -0,0 +1,19 @@ +pyorderly.outpack.init +====================== + +.. py:module:: pyorderly.outpack.init + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.init.outpack_init + + +Module Contents +--------------- + +.. py:function:: outpack_init(path, *, path_archive='archive', use_file_store=False, require_complete_tree=False) + diff --git a/_sources/autoapi/pyorderly/outpack/location/index.rst.txt b/_sources/autoapi/pyorderly/outpack/location/index.rst.txt new file mode 100644 index 0000000..e980717 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/location/index.rst.txt @@ -0,0 +1,34 @@ +pyorderly.outpack.location +========================== + +.. py:module:: pyorderly.outpack.location + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.location.outpack_location_list + pyorderly.outpack.location.outpack_location_add + pyorderly.outpack.location.outpack_location_add_path + pyorderly.outpack.location.outpack_location_remove + pyorderly.outpack.location.outpack_location_rename + pyorderly.outpack.location.location_resolve_valid + + +Module Contents +--------------- + +.. py:function:: outpack_location_list(root=None, *, locate=True) + +.. py:function:: outpack_location_add(name, type, args, root=None, *, locate=True) + +.. py:function:: outpack_location_add_path(name, path, root=None, *, locate=True) + +.. py:function:: outpack_location_remove(name, root=None, *, locate=True) + +.. py:function:: outpack_location_rename(old, new, root=None, *, locate=True) + +.. py:function:: location_resolve_valid(location, root, *, include_local, include_orphan, allow_no_locations) + diff --git a/_sources/autoapi/pyorderly/outpack/location_driver/index.rst.txt b/_sources/autoapi/pyorderly/outpack/location_driver/index.rst.txt new file mode 100644 index 0000000..804c5c9 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/location_driver/index.rst.txt @@ -0,0 +1,43 @@ +pyorderly.outpack.location_driver +================================= + +.. py:module:: pyorderly.outpack.location_driver + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.location_driver.LocationDriver + + +Module Contents +--------------- + +.. py:class:: LocationDriver + + Bases: :py:obj:`contextlib.AbstractContextManager` + + + A location implementation. + + The driver object is treated as a context manager and is entered and exited + before and after its methods are called. + + + .. py:method:: list() -> Dict[str, pyorderly.outpack.metadata.PacketLocation] + :abstractmethod: + + + + .. py:method:: metadata(packet_ids: List[str]) -> Dict[str, str] + :abstractmethod: + + + + .. py:method:: fetch_file(packet: pyorderly.outpack.metadata.MetadataCore, file: pyorderly.outpack.metadata.PacketFile, dest: str) -> None + :abstractmethod: + + + diff --git a/_sources/autoapi/pyorderly/outpack/location_path/index.rst.txt b/_sources/autoapi/pyorderly/outpack/location_path/index.rst.txt new file mode 100644 index 0000000..9a2e4d4 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/location_path/index.rst.txt @@ -0,0 +1,49 @@ +pyorderly.outpack.location_path +=============================== + +.. py:module:: pyorderly.outpack.location_path + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.location_path.OutpackLocationPath + + +Module Contents +--------------- + +.. py:class:: OutpackLocationPath(path) + + Bases: :py:obj:`pyorderly.outpack.location_driver.LocationDriver` + + + A location implementation. + + The driver object is treated as a context manager and is entered and exited + before and after its methods are called. + + + .. py:method:: __enter__() + + Return `self` upon entering the runtime context. + + + + .. py:method:: __exit__(exc_type, exc_value, exc_tb) + + Raise any exception triggered within the runtime context. + + + + .. py:method:: list() -> Dict[str, pyorderly.outpack.metadata.PacketLocation] + + + .. py:method:: metadata(packet_ids: List[str]) -> Dict[str, str] + + + .. py:method:: fetch_file(_packet: pyorderly.outpack.metadata.MetadataCore, file: pyorderly.outpack.metadata.PacketFile, dest: str) + + diff --git a/_sources/autoapi/pyorderly/outpack/location_pull/index.rst.txt b/_sources/autoapi/pyorderly/outpack/location_pull/index.rst.txt new file mode 100644 index 0000000..ddf93a6 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/location_pull/index.rst.txt @@ -0,0 +1,109 @@ +pyorderly.outpack.location_pull +=============================== + +.. py:module:: pyorderly.outpack.location_pull + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.location_pull.PullPlanInfo + pyorderly.outpack.location_pull.LocationPullPlan + pyorderly.outpack.location_pull.PullPlanPackets + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.location_pull.outpack_location_pull_metadata + pyorderly.outpack.location_pull.outpack_location_pull_packet + pyorderly.outpack.location_pull.location_pull_files + pyorderly.outpack.location_pull.location_build_pull_plan + + +Module Contents +--------------- + +.. py:function:: outpack_location_pull_metadata(location=None, root=None, *, locate=True) + +.. py:function:: outpack_location_pull_packet(ids: Union[str, List[str]], *, options: Optional[pyorderly.outpack.search_options.SearchOptions] = None, recursive: Optional[bool] = None, root: Union[str, pyorderly.outpack.root.OutpackRoot, None] = None, locate: bool = True) + +.. py:function:: location_pull_files(files: List[pyorderly.outpack.metadata.PacketFileWithLocation], root: pyorderly.outpack.root.OutpackRoot) -> Generator[pyorderly.outpack.filestore.FileStore, None, None] + +.. py:class:: PullPlanInfo + + .. py:attribute:: n_extra + :type: int + + + .. py:attribute:: n_skip + :type: int + + + .. py:attribute:: n_total + :type: int + + +.. py:class:: LocationPullPlan + + .. py:attribute:: packets + :type: Dict[str, pyorderly.outpack.metadata.PacketLocation] + + + .. py:attribute:: files + :type: List[pyorderly.outpack.metadata.PacketFileWithLocation] + + + .. py:attribute:: info + :type: PullPlanInfo + + +.. py:class:: PullPlanPackets + + .. py:attribute:: requested + :type: List[str] + + + .. py:attribute:: full + :type: List[str] + + + .. py:attribute:: skip + :type: Set[str] + + + .. py:attribute:: fetch + :type: Set[str] + + +.. py:function:: location_build_pull_plan(packet_ids: List[str], locations: Optional[List[str]], *, files: Optional[Dict[str, List[str]]] = None, recursive: bool, root: pyorderly.outpack.root.OutpackRoot) -> LocationPullPlan + + Create a plan to pull packets from one or more locations. + + Parameters + ---------- + packet_ids : + A list of packet IDs to pull. + + locations : + A list of location names from which to pull packets. If None, all + configured locations will be considered. + + files : + A filter restricting, for each packet, which file hashes to pull. This + allows a subset of a packet's files to pulled. If None, or if a packet + ID is mising from the dictionary, the entire packet is pulled. + + recursive : + If True, all transitive dependencies of the requested packets will be + pulled as well. + + root : + The root object used to determine the location configuration and which + files are missing and need pulling. + + diff --git a/_sources/autoapi/pyorderly/outpack/location_ssh/index.rst.txt b/_sources/autoapi/pyorderly/outpack/location_ssh/index.rst.txt new file mode 100644 index 0000000..c281756 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/location_ssh/index.rst.txt @@ -0,0 +1,68 @@ +pyorderly.outpack.location_ssh +============================== + +.. py:module:: pyorderly.outpack.location_ssh + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.location_ssh.OutpackLocationSSH + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.location_ssh.parse_ssh_url + + +Module Contents +--------------- + +.. py:function:: parse_ssh_url(url) + + Parse the URL of an SSH location. + + URLs have the form `ssh://username@hostname:port/path`. The username and + port number are optional. By default, the path is interpreted as relative + to the remote user's home directory. In order to use an absolute path on + the remote server, an additional forward slash must be used, eg. + `ssh://hostname//foo/bar`. + + +.. py:class:: OutpackLocationSSH(url: str, known_hosts=None, password=None) + + Bases: :py:obj:`pyorderly.outpack.location_driver.LocationDriver` + + + A location implementation. + + The driver object is treated as a context manager and is entered and exited + before and after its methods are called. + + + .. py:method:: __enter__() + + Return `self` upon entering the runtime context. + + + + .. py:method:: __exit__(*args) + + Raise any exception triggered within the runtime context. + + + + .. py:method:: list() -> Dict[str, pyorderly.outpack.metadata.PacketLocation] + + + .. py:method:: metadata(ids: List[str]) -> Dict[str, str] + + + .. py:method:: fetch_file(packet: pyorderly.outpack.metadata.MetadataCore, file: pyorderly.outpack.metadata.PacketFile, dest: str) + + diff --git a/_sources/autoapi/pyorderly/outpack/metadata/index.rst.txt b/_sources/autoapi/pyorderly/outpack/metadata/index.rst.txt new file mode 100644 index 0000000..17abac8 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/metadata/index.rst.txt @@ -0,0 +1,166 @@ +pyorderly.outpack.metadata +========================== + +.. py:module:: pyorderly.outpack.metadata + + +Attributes +---------- + +.. autoapisummary:: + + pyorderly.outpack.metadata.Parameters + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.metadata.PacketFile + pyorderly.outpack.metadata.PacketFileWithLocation + pyorderly.outpack.metadata.PacketDependsPath + pyorderly.outpack.metadata.PacketDepends + pyorderly.outpack.metadata.MetadataCore + pyorderly.outpack.metadata.PacketLocation + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.metadata.read_metadata_core + pyorderly.outpack.metadata.read_packet_location + + +Module Contents +--------------- + +.. py:class:: PacketFile + + .. py:attribute:: path + :type: str + + + .. py:attribute:: size + :type: float + + + .. py:attribute:: hash + :type: str + + + .. py:method:: from_file(directory, path, hash_algorithm) + :staticmethod: + + + +.. py:class:: PacketFileWithLocation + + Bases: :py:obj:`PacketFile` + + + .. py:attribute:: location + :type: str + + + .. py:attribute:: packet_id + :type: str + + + .. py:method:: from_packet_file(file: PacketFile, location: str, packet_id: str) + :staticmethod: + + + +.. py:class:: PacketDependsPath + + .. py:attribute:: here + :type: str + + + .. py:attribute:: there + :type: str + + +.. py:class:: PacketDepends + + .. py:attribute:: packet + :type: str + + + .. py:attribute:: query + :type: str + + + .. py:attribute:: files + :type: List[PacketDependsPath] + + + .. py:method:: files_from_dict(files) + :staticmethod: + + + +.. py:data:: Parameters + +.. py:class:: MetadataCore + + .. py:attribute:: schema_version + :type: str + + + .. py:attribute:: id + :type: str + + + .. py:attribute:: name + :type: str + + + .. py:attribute:: parameters + :type: Parameters + + + .. py:attribute:: time + :type: Dict[str, float] + + + .. py:attribute:: files + :type: List[PacketFile] + + + .. py:attribute:: depends + :type: List[PacketDepends] + + + .. py:attribute:: git + :type: Optional[pyorderly.outpack.tools.GitInfo] + + + .. py:attribute:: custom + :type: Optional[dict] + + + .. py:method:: file_hash(name) + + +.. py:class:: PacketLocation + + .. py:attribute:: packet + :type: str + + + .. py:attribute:: time + :type: float + + + .. py:attribute:: hash + :type: str + + +.. py:function:: read_metadata_core(path) -> MetadataCore + +.. py:function:: read_packet_location(path) -> PacketLocation + diff --git a/_sources/autoapi/pyorderly/outpack/packet/index.rst.txt b/_sources/autoapi/pyorderly/outpack/packet/index.rst.txt new file mode 100644 index 0000000..c32c9a7 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/packet/index.rst.txt @@ -0,0 +1,80 @@ +pyorderly.outpack.packet +======================== + +.. py:module:: pyorderly.outpack.packet + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.packet.Packet + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.packet.insert_packet + + +Module Contents +--------------- + +.. py:class:: Packet(root, path, name, *, parameters=None, id=None, locate=True) + + .. py:attribute:: root + + + .. py:attribute:: path + + + .. py:attribute:: name + + + .. py:attribute:: parameters + + + .. py:attribute:: depends + :value: [] + + + + .. py:attribute:: files + :value: [] + + + + .. py:attribute:: time + + + .. py:attribute:: git + + + .. py:attribute:: custom + + + .. py:attribute:: metadata + :value: None + + + + .. py:attribute:: immutable + + + .. py:method:: use_dependency(query, files=None, search_options=None) + + + .. py:method:: mark_file_immutable(path) + + + .. py:method:: add_custom_metadata(key, value) + + + .. py:method:: end(*, succesful=True) + + +.. py:function:: insert_packet(root, path, meta) + diff --git a/_sources/autoapi/pyorderly/outpack/root/index.rst.txt b/_sources/autoapi/pyorderly/outpack/root/index.rst.txt new file mode 100644 index 0000000..7c53d26 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/root/index.rst.txt @@ -0,0 +1,53 @@ +pyorderly.outpack.root +====================== + +.. py:module:: pyorderly.outpack.root + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.root.OutpackRoot + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.root.root_open + pyorderly.outpack.root.find_file_by_hash + pyorderly.outpack.root.mark_known + + +Module Contents +--------------- + +.. py:class:: OutpackRoot(path) + + .. py:attribute:: files + :type: Optional[pyorderly.outpack.filestore.FileStore] + :value: None + + + + .. py:attribute:: path + + + .. py:attribute:: config + + + .. py:attribute:: index + + + .. py:method:: export_file(id, there, here, dest) + + +.. py:function:: root_open(path: Union[OutpackRoot, str, os.PathLike, None], *, locate: bool = False) -> OutpackRoot + +.. py:function:: find_file_by_hash(root, hash) + +.. py:function:: mark_known(root, packet_id, location, hash, time) + diff --git a/_sources/autoapi/pyorderly/outpack/sandbox/index.rst.txt b/_sources/autoapi/pyorderly/outpack/sandbox/index.rst.txt new file mode 100644 index 0000000..463d82f --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/sandbox/index.rst.txt @@ -0,0 +1,49 @@ +pyorderly.outpack.sandbox +========================= + +.. py:module:: pyorderly.outpack.sandbox + + +Attributes +---------- + +.. autoapisummary:: + + pyorderly.outpack.sandbox.result + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.sandbox.run_in_sandbox + + +Module Contents +--------------- + +.. py:function:: run_in_sandbox(target, args=(), cwd=None, syspath=None) + + Run a function as a separate process. + + The function, its arguments and return value must be picklable. + + Parameters + ---------- + target: + The function to run in the subprocess. This function must be accessible + by name from the top level of a module in order to be pickled. + args: + The arguments to be passed to the function + cwd: + The working directory in which the subprocess runs. If None, it inherits + the current process' working directory. + syspath: + A list of paths to be added to the child process' Python search path. + This is used when the target function's module is not globally + available. + + +.. py:data:: result + diff --git a/_sources/autoapi/pyorderly/outpack/schema/index.rst.txt b/_sources/autoapi/pyorderly/outpack/schema/index.rst.txt new file mode 100644 index 0000000..2514722 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/schema/index.rst.txt @@ -0,0 +1,28 @@ +pyorderly.outpack.schema +======================== + +.. py:module:: pyorderly.outpack.schema + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.schema.validate + pyorderly.outpack.schema.retrieve_from_filesystem + pyorderly.outpack.schema.outpack_schema_version + pyorderly.outpack.schema.read_schema + + +Package Contents +---------------- + +.. py:function:: validate(instance, schema_name) + +.. py:function:: retrieve_from_filesystem(path: str) + +.. py:function:: outpack_schema_version() + +.. py:function:: read_schema(name) + diff --git a/_sources/autoapi/pyorderly/outpack/search/index.rst.txt b/_sources/autoapi/pyorderly/outpack/search/index.rst.txt new file mode 100644 index 0000000..dcee73b --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/search/index.rst.txt @@ -0,0 +1,128 @@ +pyorderly.outpack.search +======================== + +.. py:module:: pyorderly.outpack.search + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.search.Query + pyorderly.outpack.search.QueryEnv + pyorderly.outpack.search.QueryIndex + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.search.as_query + pyorderly.outpack.search.search + pyorderly.outpack.search.search_unique + pyorderly.outpack.search.eval_test_value + pyorderly.outpack.search.eval_latest + pyorderly.outpack.search.eval_single + pyorderly.outpack.search.eval_test_one + pyorderly.outpack.search.eval_test + pyorderly.outpack.search.eval_boolean + pyorderly.outpack.search.eval_negation + pyorderly.outpack.search.eval_query + + +Module Contents +--------------- + +.. py:class:: Query + + .. py:attribute:: text + :type: str + + + .. py:attribute:: node + :type: Any + + + .. py:method:: __str__() + + Return str(self). + + + + .. py:method:: parse(text) + :classmethod: + + + + .. py:method:: is_single_valued() + + Return true if the query is guaranteed to produce at most a single result. + + This could be either an expression wrapped in a `single(...)` or + `latest(...)` call, or it is an ID lookup of the form `id == ...`. + + + +.. py:class:: QueryEnv(root: pyorderly.outpack.root.OutpackRoot, options: pyorderly.outpack.search_options.SearchOptions, this: Optional[pyorderly.outpack.metadata.Parameters]) + + .. py:attribute:: index + + + .. py:attribute:: this + + +.. py:class:: QueryIndex(root, options) + + .. py:attribute:: root + :type: pyorderly.outpack.root.OutpackRoot + + + .. py:attribute:: index + :type: Dict[str, pyorderly.outpack.metadata.MetadataCore] + + + .. py:attribute:: options + :type: pyorderly.outpack.search_options.SearchOptions + + + .. py:attribute:: locations + + + .. py:attribute:: ids + + +.. py:function:: as_query(query: Union[Query, str]) -> Query + +.. py:function:: search(query: Union[Query, str], *, root: Union[pyorderly.outpack.root.OutpackRoot, str, os.PathLike], options: Optional[pyorderly.outpack.search_options.SearchOptions] = None, this: Optional[pyorderly.outpack.metadata.Parameters] = None) -> Set[str] + + Search an outpack repository for all packets that match the given query. + + This may return zero or more packet IDs. + + +.. py:function:: search_unique(query: Union[Query, str], *, root: Union[pyorderly.outpack.root.OutpackRoot, str, os.PathLike], options: Optional[pyorderly.outpack.search_options.SearchOptions] = None, this: Optional[pyorderly.outpack.metadata.Parameters] = None) + + Search an outpack repository for a packet that matches the given query. + + Returns a single packet ID. Throws an exception if no packet is found or if + the query is not syntactically guaranteed to find at most one. + + +.. py:function:: eval_test_value(node, env: QueryEnv, metadata: pyorderly.outpack.metadata.MetadataCore) -> Optional[Union[bool, int, float, str]] + +.. py:function:: eval_latest(node: outpack_query_parser.Latest, env: QueryEnv) -> Set[str] + +.. py:function:: eval_single(node: outpack_query_parser.Single, env: QueryEnv) -> Set[str] + +.. py:function:: eval_test_one(node: outpack_query_parser.Test, env: QueryEnv, metadata: pyorderly.outpack.metadata.MetadataCore) -> bool + +.. py:function:: eval_test(node: outpack_query_parser.Test, env: QueryEnv) -> Set[str] + +.. py:function:: eval_boolean(node: outpack_query_parser.BooleanExpr, env: QueryEnv) -> Set[str] + +.. py:function:: eval_negation(node: outpack_query_parser.Negation, env: QueryEnv) -> Set[str] + +.. py:function:: eval_query(node, env: QueryEnv) -> Set[str] + diff --git a/_sources/autoapi/pyorderly/outpack/search_options/index.rst.txt b/_sources/autoapi/pyorderly/outpack/search_options/index.rst.txt new file mode 100644 index 0000000..b4da16b --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/search_options/index.rst.txt @@ -0,0 +1,72 @@ +pyorderly.outpack.search_options +================================ + +.. py:module:: pyorderly.outpack.search_options + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.search_options.SearchOptions + + +Module Contents +--------------- + +.. py:class:: SearchOptions + + Control over how outpack will search for packets. + + Attributes + ---------- + location : array of strings, optional + Locations that will be included for search. If `None`, then all + known locations will be included + allow_remote : bool + Indicates if we will consider packets that are only available + remotely to be found. + pull_metadata : bool + Indicates if we will pull metadata from the locations before + searching + + + .. py:attribute:: location + :type: Optional[List[str]] + :value: None + + + + .. py:attribute:: allow_remote + :type: bool + :value: False + + + + .. py:attribute:: pull_metadata + :type: bool + :value: False + + + + .. py:method:: create(obj) + :staticmethod: + + + Construct a `SearchOptions` object from some object. + + Parameters + ---------- + obj : any + Typically this will be `None` (default construct the + `SearchOptions` object), a `SearchOptions` object or a `dict` + with some of the fields present in `SearchOptions`. An + `TypeError` is thrown if any other type is passed. + + Returns + ------- + A new `SearchOptions` object. + + + diff --git a/_sources/autoapi/pyorderly/outpack/static/index.rst.txt b/_sources/autoapi/pyorderly/outpack/static/index.rst.txt new file mode 100644 index 0000000..946eff8 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/static/index.rst.txt @@ -0,0 +1,32 @@ +pyorderly.outpack.static +======================== + +.. py:module:: pyorderly.outpack.static + + +Attributes +---------- + +.. autoapisummary:: + + pyorderly.outpack.static.LOCATION_LOCAL + pyorderly.outpack.static.LOCATION_ORPHAN + pyorderly.outpack.static.LOCATION_RESERVED_NAME + pyorderly.outpack.static.LOCATION_TYPES + + +Module Contents +--------------- + +.. py:data:: LOCATION_LOCAL + :value: 'local' + + +.. py:data:: LOCATION_ORPHAN + :value: 'orphan' + + +.. py:data:: LOCATION_RESERVED_NAME + +.. py:data:: LOCATION_TYPES + diff --git a/_sources/autoapi/pyorderly/outpack/tools/index.rst.txt b/_sources/autoapi/pyorderly/outpack/tools/index.rst.txt new file mode 100644 index 0000000..6dd794a --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/tools/index.rst.txt @@ -0,0 +1,41 @@ +pyorderly.outpack.tools +======================= + +.. py:module:: pyorderly.outpack.tools + + +Classes +------- + +.. autoapisummary:: + + pyorderly.outpack.tools.GitInfo + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.tools.git_info + + +Module Contents +--------------- + +.. py:class:: GitInfo + + .. py:attribute:: sha + :type: str + + + .. py:attribute:: branch + :type: str + + + .. py:attribute:: url + :type: List[str] + + +.. py:function:: git_info(path) + diff --git a/_sources/autoapi/pyorderly/outpack/util/index.rst.txt b/_sources/autoapi/pyorderly/outpack/util/index.rst.txt new file mode 100644 index 0000000..ecd8cf8 --- /dev/null +++ b/_sources/autoapi/pyorderly/outpack/util/index.rst.txt @@ -0,0 +1,88 @@ +pyorderly.outpack.util +====================== + +.. py:module:: pyorderly.outpack.util + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.outpack.util.find_file_descend + pyorderly.outpack.util.iso_time_str + pyorderly.outpack.util.time_to_num + pyorderly.outpack.util.num_to_time + pyorderly.outpack.util.all_normal_files + pyorderly.outpack.util.transient_working_directory + pyorderly.outpack.util.assert_file_exists + pyorderly.outpack.util.assert_relative_path + pyorderly.outpack.util.expand_dirs + pyorderly.outpack.util.match_value + pyorderly.outpack.util.relative_path_array + pyorderly.outpack.util.relative_path_mapping + pyorderly.outpack.util.read_string + pyorderly.outpack.util.format_list + pyorderly.outpack.util.pl + pyorderly.outpack.util.partition + pyorderly.outpack.util.openable_temporary_file + pyorderly.outpack.util.as_posix_path + pyorderly.outpack.util.removeprefix + + +Module Contents +--------------- + +.. py:function:: find_file_descend(filename, path) + +.. py:function:: iso_time_str(t) + +.. py:function:: time_to_num(x) + +.. py:function:: num_to_time(x) + +.. py:function:: all_normal_files(path) + +.. py:function:: transient_working_directory(path) + +.. py:function:: assert_file_exists(path, *, workdir=None, name='File') + +.. py:function:: assert_relative_path(path: str, name: str) + +.. py:function:: expand_dirs(paths, *, workdir=None) + +.. py:function:: match_value(arg, choices, name) + +.. py:function:: relative_path_array(files: Union[str, List[str]], name: str) -> List[str] + +.. py:function:: relative_path_mapping(files: Union[str, List[str], Dict[str, str]], name: str) -> Dict[str, str] + +.. py:function:: read_string(path) + +.. py:function:: format_list(x) + +.. py:function:: pl(x, singular, plural=None) + +.. py:function:: partition(pred, iterable) + + Partition entries into false entries and true entries. + + This is slightly modified version of partition from itertools + recipes https://docs.python.org/dev/library/itertools.html#itertools-recipes + If *pred* is slow, consider wrapping it with functools.lru_cache(). + + +.. py:function:: openable_temporary_file(*, mode: str = 'w+b', dir: Optional[str] = None) + +.. py:function:: as_posix_path(paths: str) -> str + as_posix_path(paths: List[str]) -> List[str] + as_posix_path(paths: Dict[str, str]) -> Dict[str, str] + + Convert a native path into a posix path. + + This is used when exporting paths into packet metadata, ensuring the + produced packets are portable across platforms. + + +.. py:function:: removeprefix(s: str, prefix: str) -> str + diff --git a/_sources/autoapi/pyorderly/read/index.rst.txt b/_sources/autoapi/pyorderly/read/index.rst.txt new file mode 100644 index 0000000..f3fd377 --- /dev/null +++ b/_sources/autoapi/pyorderly/read/index.rst.txt @@ -0,0 +1,37 @@ +pyorderly.read +============== + +.. py:module:: pyorderly.read + + +Classes +------- + +.. autoapisummary:: + + pyorderly.read.Visitor + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.read.orderly_read + + +Module Contents +--------------- + +.. py:function:: orderly_read(path) + +.. py:class:: Visitor + + .. py:attribute:: parameters + :value: None + + + + .. py:method:: read_body(stmts) + + diff --git a/_sources/autoapi/pyorderly/run/index.rst.txt b/_sources/autoapi/pyorderly/run/index.rst.txt new file mode 100644 index 0000000..68422bb --- /dev/null +++ b/_sources/autoapi/pyorderly/run/index.rst.txt @@ -0,0 +1,19 @@ +pyorderly.run +============= + +.. py:module:: pyorderly.run + + +Functions +--------- + +.. autoapisummary:: + + pyorderly.run.orderly_run + + +Module Contents +--------------- + +.. py:function:: orderly_run(name, *, parameters=None, search_options=None, root=None, locate=True) + diff --git a/_static/searchtools.js b/_static/searchtools.js index 92da3f8..b08d58c 100644 --- a/_static/searchtools.js +++ b/_static/searchtools.js @@ -178,7 +178,7 @@ const Search = { htmlToText: (htmlString, anchor) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - for (const removalQuery of [".headerlinks", "script", "style"]) { + for (const removalQuery of [".headerlink", "script", "style"]) { htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); } if (anchor) { @@ -328,13 +328,14 @@ const Search = { for (const [title, foundTitles] of Object.entries(allTitles)) { if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { for (const [file, id] of foundTitles) { - let score = Math.round(100 * queryLower.length / title.length) + const score = Math.round(Scorer.title * queryLower.length / title.length); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles normalResults.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, id !== null ? "#" + id : "", null, - score, + score + boost, filenames[file], ]); } diff --git a/autoapi/index.html b/autoapi/index.html index e983275..b08f12f 100644 --- a/autoapi/index.html +++ b/autoapi/index.html @@ -4,7 +4,7 @@ - API Reference — outpack-py 0.0.1 documentation + API Reference — pyorderly 0.0.1 documentation @@ -25,7 +25,7 @@ - + @@ -38,7 +38,7 @@ - outpack-py + pyorderly
@@ -50,11 +50,10 @@