Skip to content

Commit

Permalink
Add docstrings for functions to retrieve and list extension info
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Jan 14, 2025
1 parent 81a2259 commit b9f8f2c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
38 changes: 35 additions & 3 deletions +matnwb/+extension/getExtensionInfo.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
function metadata = getExtensionInfo(extensionName)
% getExtensionInfo - Get metadata for specified extension
function info = getExtensionInfo(extensionName)
% getExtensionInfo - Get metadata for the specified Neurodata extension
%
% Syntax:
% info = matnwb.extension.GETEXTENSIONINFO(extensionName) Returns a struct
% with metadata/information about the specified extension. The extension
% must be registered in the Neurodata Extension Catalog.
%
% Input Arguments:
% - extensionName (string) -
% Name of a Neurodata Extension, e.g "ndx-miniscope".
%
% Output Arguments:
% - info (struct) -
% Struct with metadata / information for the specified extension. The struct
% has the following fields
% - name : The name of the extension.
% - version : The current version of the extension.
% - last_updated : A timestamp indicating when the extension was last updated.
% - src : The URL to the source repository or homepage of the extension.
% - license : The license type under which the extension is distributed.
% - maintainers : A cell array or array of strings listing the maintainers.
% - readme : A string containing the README documentation or description.
%
% Usage:
% Example 1 - Retrieve and display information for the 'ndx-miniscope' extension::
%
% info = matnwb.extension.getExtensionInfo('ndx-miniscope');
%
% % Display the version of the extension.
% fprintf('Extension version: %s\n', info.version);
%
% See also:
% matnwb.extension.listExtensions

arguments
extensionName (1,1) string
Expand All @@ -12,5 +44,5 @@
any(isMatch), ...
'NWB:DisplayExtensionMetadata:ExtensionNotFound', ...
'Extension "%s" was not found in the extension catalog:\n%s', extensionName, extensionList)
metadata = table2struct(T(isMatch, :));
info = table2struct(T(isMatch, :));
end
22 changes: 22 additions & 0 deletions +matnwb/+extension/listExtensions.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
function extensionTable = listExtensions(options)
% listExtensions - List available extensions in the Neurodata Extension Catalog
%
% Syntax:
% extensionTable = matnwb.extension.listExtensions() returns a table where
% each row holds information about a registered extension.
%
% Output Arguments:
% - extensionTable (table) -
% Table of metadata / information for each registered extension. The table
% has the following columns
% - name : The name of the extension.
% - version : The current version of the extension.
% - last_updated : A timestamp indicating when the extension was last updated.
% - src : The URL to the source repository or homepage of the extension.
% - license : The license type under which the extension is distributed.
% - maintainers : A cell array or array of strings listing the maintainers.
% - readme : A string containing the README documentation or description.
%
% See also: matnwb.extension.getExtensionInfo

arguments
% Refresh - Flag to refresh the catalog (Only relevant if the
% remote catalog has been updated).
options.Refresh (1,1) logical = false
end

Expand Down

0 comments on commit b9f8f2c

Please sign in to comment.