From e1f4859e34117823be6c3c9d43097a9848d7a55c Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 9 Oct 2019 12:55:30 -0700 Subject: [PATCH 01/10] NEW: Add type, format, transformer info to plugin pages --- .../plugin_directory/extension.py | 13 ++++++++- .../plugin_directory/templates/plugin.rst | 27 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/source/sphinx_extensions/plugin_directory/extension.py b/source/sphinx_extensions/plugin_directory/extension.py index ef840e82..2a7837d2 100644 --- a/source/sphinx_extensions/plugin_directory/extension.py +++ b/source/sphinx_extensions/plugin_directory/extension.py @@ -46,6 +46,16 @@ def generate_rst(app): fh.write(rendered) for plugin in plugins.values(): + transformers_list = [] + + for from_type, to_type in plugin.transformers: + from_type = repr(from_type).split('.')[-1].replace("'>", '') + to_type = repr(to_type).split('.')[-1].replace("'>", '') + + transformers_list.append((from_type, to_type)) + + transformers_list.sort(key=lambda element: (element[0], element[1])) + plugin_cli_name = plugin.name.replace('_', '-') plugin_dir = os.path.join(rst_dir, plugin_cli_name) os.mkdir(plugin_dir) @@ -53,7 +63,8 @@ def generate_rst(app): index_path = os.path.join(plugin_dir, 'index.rst') with open(index_path, 'w') as fh: template = env.get_template('plugin.rst') - rendered = template.render(title=plugin_cli_name, plugin=plugin) + rendered = template.render(title=plugin_cli_name, plugin=plugin, + transformers_list=transformers_list) fh.write(rendered) if plugin.citations: diff --git a/source/sphinx_extensions/plugin_directory/templates/plugin.rst b/source/sphinx_extensions/plugin_directory/templates/plugin.rst index b2b1da9d..d2c55434 100644 --- a/source/sphinx_extensions/plugin_directory/templates/plugin.rst +++ b/source/sphinx_extensions/plugin_directory/templates/plugin.rst @@ -112,3 +112,30 @@ Visualizers {{ id.replace('_', '-') }} {% endfor %} {% endif %} + +{% if plugin.types %} +Types +----- + +{% for id, _ in plugin.types|dictsort %} +- {{ id }} +{% endfor %} +{% endif %} + +{% if plugin.formats %} +Formats +------- + +{% for id, _ in plugin.formats|dictsort %} +- {{ id }} +{% endfor %} +{% endif %} + +{% if plugin.transformers %} +Transformers +------------ + +{% for from, to in transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} +{% endif %} From ef5ce7c7284b9154c2b477df73e0cec4bd24e71d Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 9 Oct 2019 12:55:30 -0700 Subject: [PATCH 02/10] NEW: Add type, format, transformer info to plugin pages Co-Authored-By: ChrisKeefe --- .../plugin_directory/extension.py | 13 ++++++++- .../plugin_directory/templates/plugin.rst | 27 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/source/sphinx_extensions/plugin_directory/extension.py b/source/sphinx_extensions/plugin_directory/extension.py index ef840e82..2a7837d2 100644 --- a/source/sphinx_extensions/plugin_directory/extension.py +++ b/source/sphinx_extensions/plugin_directory/extension.py @@ -46,6 +46,16 @@ def generate_rst(app): fh.write(rendered) for plugin in plugins.values(): + transformers_list = [] + + for from_type, to_type in plugin.transformers: + from_type = repr(from_type).split('.')[-1].replace("'>", '') + to_type = repr(to_type).split('.')[-1].replace("'>", '') + + transformers_list.append((from_type, to_type)) + + transformers_list.sort(key=lambda element: (element[0], element[1])) + plugin_cli_name = plugin.name.replace('_', '-') plugin_dir = os.path.join(rst_dir, plugin_cli_name) os.mkdir(plugin_dir) @@ -53,7 +63,8 @@ def generate_rst(app): index_path = os.path.join(plugin_dir, 'index.rst') with open(index_path, 'w') as fh: template = env.get_template('plugin.rst') - rendered = template.render(title=plugin_cli_name, plugin=plugin) + rendered = template.render(title=plugin_cli_name, plugin=plugin, + transformers_list=transformers_list) fh.write(rendered) if plugin.citations: diff --git a/source/sphinx_extensions/plugin_directory/templates/plugin.rst b/source/sphinx_extensions/plugin_directory/templates/plugin.rst index b2b1da9d..d2c55434 100644 --- a/source/sphinx_extensions/plugin_directory/templates/plugin.rst +++ b/source/sphinx_extensions/plugin_directory/templates/plugin.rst @@ -112,3 +112,30 @@ Visualizers {{ id.replace('_', '-') }} {% endfor %} {% endif %} + +{% if plugin.types %} +Types +----- + +{% for id, _ in plugin.types|dictsort %} +- {{ id }} +{% endfor %} +{% endif %} + +{% if plugin.formats %} +Formats +------- + +{% for id, _ in plugin.formats|dictsort %} +- {{ id }} +{% endfor %} +{% endif %} + +{% if plugin.transformers %} +Transformers +------------ + +{% for from, to in transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} +{% endif %} From f13bc64ef7076c42e8812620d0413dbda449e4b2 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 10 Oct 2019 07:33:13 -0700 Subject: [PATCH 03/10] SQUASH: Fix some issues with python built-ins displaying and sorting --- .../sphinx_extensions/plugin_directory/extension.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/sphinx_extensions/plugin_directory/extension.py b/source/sphinx_extensions/plugin_directory/extension.py index 2a7837d2..3a47453e 100644 --- a/source/sphinx_extensions/plugin_directory/extension.py +++ b/source/sphinx_extensions/plugin_directory/extension.py @@ -49,12 +49,18 @@ def generate_rst(app): transformers_list = [] for from_type, to_type in plugin.transformers: - from_type = repr(from_type).split('.')[-1].replace("'>", '') - to_type = repr(to_type).split('.')[-1].replace("'>", '') + from_type = repr(from_type) \ + .replace("", "").split('.')[-1] + to_type = repr(to_type) \ + .replace("", "").split('.')[-1] transformers_list.append((from_type, to_type)) - transformers_list.sort(key=lambda element: (element[0], element[1])) + # .upper() because Python sorts all capitalized elements above all + # lowercase ones, and I figured we didn't want 'dict' sorting under + # 'TaxonomicClassifierDirFmt' + transformers_list.sort( + key=lambda element: (element[0].upper(), element[1].upper())) plugin_cli_name = plugin.name.replace('_', '-') plugin_dir = os.path.join(rst_dir, plugin_cli_name) From 59d180a7150f2efb25dc85c69dd79305bb708310 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 10 Oct 2019 08:52:16 -0700 Subject: [PATCH 04/10] SQUASH: Addressing @thermokarst's review --- source/sphinx_extensions/plugin_directory/extension.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/sphinx_extensions/plugin_directory/extension.py b/source/sphinx_extensions/plugin_directory/extension.py index 3a47453e..da887e09 100644 --- a/source/sphinx_extensions/plugin_directory/extension.py +++ b/source/sphinx_extensions/plugin_directory/extension.py @@ -14,6 +14,7 @@ import jinja2 import qiime2.sdk +import qiime2.core from sphinx.util import logging logger = logging.getLogger(__name__) @@ -49,10 +50,8 @@ def generate_rst(app): transformers_list = [] for from_type, to_type in plugin.transformers: - from_type = repr(from_type) \ - .replace("", "").split('.')[-1] - to_type = repr(to_type) \ - .replace("", "").split('.')[-1] + from_type = qiime2.core.util.get_view_name(from_type) + to_type = qiime2.core.util.get_view_name(to_type) transformers_list.append((from_type, to_type)) From 7d0436e1d95db9dbe218fc188c4517fb70c541b5 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 4 Nov 2019 15:18:09 -0700 Subject: [PATCH 05/10] SQUASH: Begin moving the types, formats, and transformers pages to a new location --- format-list.rst | 151 +++++++++ formats-list.rst | 151 +++++++++ source/conf.py | 5 +- source/formats-list.rst | 151 +++++++++ source/index.rst | 3 + source/sphinx_extensions/formats/__init__.py | 11 + source/sphinx_extensions/formats/extension.py | 48 +++ .../formats/templates/format-list.rst | 18 + .../plugin_directory/templates/plugin.rst | 27 -- .../transformers/__init__.py | 11 + .../transformers/extension.py | 34 ++ .../transformers/templates/transformers.rst | 12 + source/sphinx_extensions/types/__init__.py | 11 + source/sphinx_extensions/types/extension.py | 38 +++ .../types/templates/types-list.rst | 6 + source/transformers.rst | 307 ++++++++++++++++++ source/types-list.rst | 85 +++++ types_list.rst | 85 +++++ 18 files changed, 1126 insertions(+), 28 deletions(-) create mode 100644 format-list.rst create mode 100644 formats-list.rst create mode 100644 source/formats-list.rst create mode 100644 source/sphinx_extensions/formats/__init__.py create mode 100644 source/sphinx_extensions/formats/extension.py create mode 100644 source/sphinx_extensions/formats/templates/format-list.rst create mode 100644 source/sphinx_extensions/transformers/__init__.py create mode 100644 source/sphinx_extensions/transformers/extension.py create mode 100644 source/sphinx_extensions/transformers/templates/transformers.rst create mode 100644 source/sphinx_extensions/types/__init__.py create mode 100644 source/sphinx_extensions/types/extension.py create mode 100644 source/sphinx_extensions/types/templates/types-list.rst create mode 100644 source/transformers.rst create mode 100644 source/types-list.rst create mode 100644 types_list.rst diff --git a/format-list.rst b/format-list.rst new file mode 100644 index 00000000..5784c972 --- /dev/null +++ b/format-list.rst @@ -0,0 +1,151 @@ +Formats List +============ + + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Importable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Exportable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- diff --git a/formats-list.rst b/formats-list.rst new file mode 100644 index 00000000..dc1b5b72 --- /dev/null +++ b/formats-list.rst @@ -0,0 +1,151 @@ +Formats List +============ + + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Importable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Exportable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- diff --git a/source/conf.py b/source/conf.py index 578c3060..a1d4c596 100644 --- a/source/conf.py +++ b/source/conf.py @@ -55,7 +55,10 @@ 'sphinx_extensions.command_block', 'sphinx_extensions.plugin_directory', 'sphinx_extensions.external_links', - 'sphinxcontrib.bibtex' + 'sphinxcontrib.bibtex', + 'sphinx_extensions.types', + 'sphinx_extensions.formats', + 'sphinx_extensions.transformers' ] # Add any paths that contain templates here, relative to this directory. diff --git a/source/formats-list.rst b/source/formats-list.rst new file mode 100644 index 00000000..e6486484 --- /dev/null +++ b/source/formats-list.rst @@ -0,0 +1,151 @@ +Formats List +============ + + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + +- "" + + +Importable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Exportable Formats +------------------ + +- + +- + +- + +- + +- + +- + +- diff --git a/source/index.rst b/source/index.rst index a123aa62..982837f2 100644 --- a/source/index.rst +++ b/source/index.rst @@ -22,6 +22,9 @@ Table of contents interfaces/index plugins/index semantic-types + types-list + formats-list + transformers community data-resources supplementary-resources diff --git a/source/sphinx_extensions/formats/__init__.py b/source/sphinx_extensions/formats/__init__.py new file mode 100644 index 00000000..deccba06 --- /dev/null +++ b/source/sphinx_extensions/formats/__init__.py @@ -0,0 +1,11 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +from .extension import setup + +__all__ = ['setup'] diff --git a/source/sphinx_extensions/formats/extension.py b/source/sphinx_extensions/formats/extension.py new file mode 100644 index 00000000..c83d066e --- /dev/null +++ b/source/sphinx_extensions/formats/extension.py @@ -0,0 +1,48 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +import os + +import jinja2 +import qiime2.sdk +import qiime2.core + +from sphinx.util import logging +logger = logging.getLogger(__name__) + + +def generate_rst(app): + pm = qiime2.sdk.PluginManager() + + loader = jinja2.PackageLoader('sphinx_extensions.formats', 'templates') + env = jinja2.Environment(loader=loader) + + importable_formats = [ + repr(importable_format) for importable_format in pm._importable] + importable_formats.sort() + + exportable_formats = [ + repr(exportable_format) for exportable_format in pm._exportable] + exportable_formats.sort() + + all_formats_set = {*importable_formats, *exportable_formats, + *[repr(format) for format in pm._canonical_formats]} + all_formats = [repr(format) for format in all_formats_set] + all_formats.sort() + + template = env.get_template('format-list.rst') + with open(os.path.join(app.env.srcdir, 'formats-list.rst'), 'w') as fh: + rendered = template.render(format_list=all_formats, + importable_formats=importable_formats, + exportable_formats=exportable_formats) + fh.write(rendered) + + +def setup(app): + app.connect('builder-inited', generate_rst) + return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/formats/templates/format-list.rst b/source/sphinx_extensions/formats/templates/format-list.rst new file mode 100644 index 00000000..165c5af4 --- /dev/null +++ b/source/sphinx_extensions/formats/templates/format-list.rst @@ -0,0 +1,18 @@ +Formats List +============ + +{% for format in format_list %} +- {{ format }} +{% endfor %} + +Importable Formats +------------------ +{% for imp in importable_formats %} +- {{ imp }} +{% endfor %} + +Exportable Formats +------------------ +{% for exp in exportable_formats %} +- {{ exp }} +{% endfor %} diff --git a/source/sphinx_extensions/plugin_directory/templates/plugin.rst b/source/sphinx_extensions/plugin_directory/templates/plugin.rst index d2c55434..b2b1da9d 100644 --- a/source/sphinx_extensions/plugin_directory/templates/plugin.rst +++ b/source/sphinx_extensions/plugin_directory/templates/plugin.rst @@ -112,30 +112,3 @@ Visualizers {{ id.replace('_', '-') }} {% endfor %} {% endif %} - -{% if plugin.types %} -Types ------ - -{% for id, _ in plugin.types|dictsort %} -- {{ id }} -{% endfor %} -{% endif %} - -{% if plugin.formats %} -Formats -------- - -{% for id, _ in plugin.formats|dictsort %} -- {{ id }} -{% endfor %} -{% endif %} - -{% if plugin.transformers %} -Transformers ------------- - -{% for from, to in transformers_list %} -- {{ from }} -> {{ to }} -{% endfor %} -{% endif %} diff --git a/source/sphinx_extensions/transformers/__init__.py b/source/sphinx_extensions/transformers/__init__.py new file mode 100644 index 00000000..deccba06 --- /dev/null +++ b/source/sphinx_extensions/transformers/__init__.py @@ -0,0 +1,11 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +from .extension import setup + +__all__ = ['setup'] diff --git a/source/sphinx_extensions/transformers/extension.py b/source/sphinx_extensions/transformers/extension.py new file mode 100644 index 00000000..f60ea863 --- /dev/null +++ b/source/sphinx_extensions/transformers/extension.py @@ -0,0 +1,34 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +import os + +import jinja2 +import qiime2.sdk +import qiime2.core + +from sphinx.util import logging +logger = logging.getLogger(__name__) + + +def generate_rst(app): + pm = qiime2.sdk.PluginManager() + + loader = jinja2.PackageLoader( + 'sphinx_extensions.transformers', 'templates') + env = jinja2.Environment(loader=loader) + + template = env.get_template('transformers.rst') + with open(os.path.join(app.env.srcdir, 'transformers.rst'), 'w') as fh: + rendered = template.render(plugin_manager=pm) + fh.write(rendered) + + +def setup(app): + app.connect('builder-inited', generate_rst) + return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/transformers/templates/transformers.rst b/source/sphinx_extensions/transformers/templates/transformers.rst new file mode 100644 index 00000000..9a7f5f00 --- /dev/null +++ b/source/sphinx_extensions/transformers/templates/transformers.rst @@ -0,0 +1,12 @@ +Transformers +============ + +{% for transfomer in plugin_manager.transformers %} +- {{ transfomer }} +{% endfor %} + +Reverse Transformers +-------------------- +{% for reverse_transformer in plugin_manager._reverse_transformers %} +- {{ reverse_transformer }} +{% endfor %} \ No newline at end of file diff --git a/source/sphinx_extensions/types/__init__.py b/source/sphinx_extensions/types/__init__.py new file mode 100644 index 00000000..deccba06 --- /dev/null +++ b/source/sphinx_extensions/types/__init__.py @@ -0,0 +1,11 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +from .extension import setup + +__all__ = ['setup'] diff --git a/source/sphinx_extensions/types/extension.py b/source/sphinx_extensions/types/extension.py new file mode 100644 index 00000000..23f6da66 --- /dev/null +++ b/source/sphinx_extensions/types/extension.py @@ -0,0 +1,38 @@ +# ---------------------------------------------------------------------------- +# Copyright (c) 2016-2019, QIIME 2 development team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file LICENSE, distributed with this software. +# ---------------------------------------------------------------------------- + +import jinja2 +import qiime2.sdk +import qiime2.core + +from sphinx.util import logging +logger = logging.getLogger(__name__) + + +def generate_rst(app): + pm = qiime2.sdk.PluginManager() + + loader = jinja2.PackageLoader('sphinx_extensions.types', + 'templates') + env = jinja2.Environment(loader=loader) + + type_list = [] + + for type in pm.get_semantic_types(): + type_list.append(repr(type)) + + type_list.sort() + template = env.get_template('types-list.rst') + with open('types_list.rst', 'w') as fh: + rendered = template.render(type_list=type_list) + fh.write(rendered) + + +def setup(app): + app.connect('builder-inited', generate_rst) + return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/types/templates/types-list.rst b/source/sphinx_extensions/types/templates/types-list.rst new file mode 100644 index 00000000..47d433ed --- /dev/null +++ b/source/sphinx_extensions/types/templates/types-list.rst @@ -0,0 +1,6 @@ +Types list +========== + +{% for type in type_list %} +- {{ type }} +{% endfor %} diff --git a/source/transformers.rst b/source/transformers.rst new file mode 100644 index 00000000..ee4854f9 --- /dev/null +++ b/source/transformers.rst @@ -0,0 +1,307 @@ +Transformers +============ + + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + +Reverse Transformers +-------------------- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- diff --git a/source/types-list.rst b/source/types-list.rst new file mode 100644 index 00000000..08e666ea --- /dev/null +++ b/source/types-list.rst @@ -0,0 +1,85 @@ +Types list +========== + + +- DeblurStats + +- DistanceMatrix + +- EMPPairedEndSequences + +- EMPSingleEndSequences + +- ErrorCorrectionDetails + +- FeatureData[AlignedSequence] + +- FeatureData[Differential] + +- FeatureData[Importance] + +- FeatureData[PairedEndSequence] + +- FeatureData[Sequence] + +- FeatureData[Taxonomy] + +- FeatureTable[Balance] + +- FeatureTable[Composition] + +- FeatureTable[Frequency] + +- FeatureTable[PercentileNormalized] + +- FeatureTable[PresenceAbsence] + +- FeatureTable[RelativeFrequency] + +- Hierarchy + +- MultiplexedPairedEndBarcodeInSequence + +- MultiplexedSingleEndBarcodeInSequence + +- PCoAResults + +- Phylogeny[Rooted] + +- Phylogeny[Unrooted] + +- Placements + +- QualityFilterStats + +- RawSequences + +- SampleData[AlphaDiversity] + +- SampleData[BooleanSeries] + +- SampleData[ClassifierPredictions] + +- SampleData[DADA2Stats] + +- SampleData[FirstDifferences] + +- SampleData[JoinedSequencesWithQuality] + +- SampleData[PairedEndSequencesWithQuality] + +- SampleData[Probabilities] + +- SampleData[RegressorPredictions] + +- SampleData[SequencesWithQuality] + +- SampleData[Sequences] + +- SampleEstimator[Classifier] + +- SampleEstimator[Regressor] + +- TaxonomicClassifier + +- UchimeStats diff --git a/types_list.rst b/types_list.rst new file mode 100644 index 00000000..08e666ea --- /dev/null +++ b/types_list.rst @@ -0,0 +1,85 @@ +Types list +========== + + +- DeblurStats + +- DistanceMatrix + +- EMPPairedEndSequences + +- EMPSingleEndSequences + +- ErrorCorrectionDetails + +- FeatureData[AlignedSequence] + +- FeatureData[Differential] + +- FeatureData[Importance] + +- FeatureData[PairedEndSequence] + +- FeatureData[Sequence] + +- FeatureData[Taxonomy] + +- FeatureTable[Balance] + +- FeatureTable[Composition] + +- FeatureTable[Frequency] + +- FeatureTable[PercentileNormalized] + +- FeatureTable[PresenceAbsence] + +- FeatureTable[RelativeFrequency] + +- Hierarchy + +- MultiplexedPairedEndBarcodeInSequence + +- MultiplexedSingleEndBarcodeInSequence + +- PCoAResults + +- Phylogeny[Rooted] + +- Phylogeny[Unrooted] + +- Placements + +- QualityFilterStats + +- RawSequences + +- SampleData[AlphaDiversity] + +- SampleData[BooleanSeries] + +- SampleData[ClassifierPredictions] + +- SampleData[DADA2Stats] + +- SampleData[FirstDifferences] + +- SampleData[JoinedSequencesWithQuality] + +- SampleData[PairedEndSequencesWithQuality] + +- SampleData[Probabilities] + +- SampleData[RegressorPredictions] + +- SampleData[SequencesWithQuality] + +- SampleData[Sequences] + +- SampleEstimator[Classifier] + +- SampleEstimator[Regressor] + +- TaxonomicClassifier + +- UchimeStats From b9a5f90db4c2c7f10ba76e258424292923c598f6 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 6 Nov 2019 08:18:53 -0700 Subject: [PATCH 06/10] SQUASH: Reformat types/formats/transformers pages --- format-list.rst | 151 ------- formats-list.rst | 151 ------- source/{ => formats-list}/formats-list.rst | 2 + source/index.rst | 6 +- source/sphinx_extensions/formats/extension.py | 18 +- .../{format-list.rst => formats-list.rst} | 2 + .../transformers/extension.py | 48 ++- .../templates/transformers-list.rst | 14 + .../transformers/templates/transformers.rst | 12 - source/sphinx_extensions/types/extension.py | 21 +- .../transformers-list/transformers-list.rst | 391 ++++++++++++++++++ source/transformers.rst | 307 -------------- source/{ => types-list}/types-list.rst | 0 types_list.rst | 85 ---- 14 files changed, 490 insertions(+), 718 deletions(-) delete mode 100644 format-list.rst delete mode 100644 formats-list.rst rename source/{ => formats-list}/formats-list.rst (99%) rename source/sphinx_extensions/formats/templates/{format-list.rst => formats-list.rst} (92%) create mode 100644 source/sphinx_extensions/transformers/templates/transformers-list.rst delete mode 100644 source/sphinx_extensions/transformers/templates/transformers.rst create mode 100644 source/transformers-list/transformers-list.rst delete mode 100644 source/transformers.rst rename source/{ => types-list}/types-list.rst (100%) delete mode 100644 types_list.rst diff --git a/format-list.rst b/format-list.rst deleted file mode 100644 index 5784c972..00000000 --- a/format-list.rst +++ /dev/null @@ -1,151 +0,0 @@ -Formats List -============ - - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Importable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Exportable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- diff --git a/formats-list.rst b/formats-list.rst deleted file mode 100644 index dc1b5b72..00000000 --- a/formats-list.rst +++ /dev/null @@ -1,151 +0,0 @@ -Formats List -============ - - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Importable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Exportable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- diff --git a/source/formats-list.rst b/source/formats-list/formats-list.rst similarity index 99% rename from source/formats-list.rst rename to source/formats-list/formats-list.rst index e6486484..a03bec0a 100644 --- a/source/formats-list.rst +++ b/source/formats-list/formats-list.rst @@ -1,6 +1,8 @@ Formats List ============ +All Formats +----------- - "" diff --git a/source/index.rst b/source/index.rst index 982837f2..190843e0 100644 --- a/source/index.rst +++ b/source/index.rst @@ -22,9 +22,9 @@ Table of contents interfaces/index plugins/index semantic-types - types-list - formats-list - transformers + types-list/types-list + formats-list/formats-list + transformers-list/transformers-list community data-resources supplementary-resources diff --git a/source/sphinx_extensions/formats/extension.py b/source/sphinx_extensions/formats/extension.py index c83d066e..389d23b9 100644 --- a/source/sphinx_extensions/formats/extension.py +++ b/source/sphinx_extensions/formats/extension.py @@ -7,6 +7,7 @@ # ---------------------------------------------------------------------------- import os +import shutil import jinja2 import qiime2.sdk @@ -22,6 +23,13 @@ def generate_rst(app): loader = jinja2.PackageLoader('sphinx_extensions.formats', 'templates') env = jinja2.Environment(loader=loader) + rst_dir = os.path.join(app.env.srcdir, 'formats-list') + app.formats_rst_dir = rst_dir + cleanup_rst(app, None) + os.mkdir(rst_dir) + + index_path = os.path.join(rst_dir, 'formats-list.rst') + importable_formats = [ repr(importable_format) for importable_format in pm._importable] importable_formats.sort() @@ -35,14 +43,20 @@ def generate_rst(app): all_formats = [repr(format) for format in all_formats_set] all_formats.sort() - template = env.get_template('format-list.rst') - with open(os.path.join(app.env.srcdir, 'formats-list.rst'), 'w') as fh: + template = env.get_template('formats-list.rst') + with open(index_path, 'w') as fh: rendered = template.render(format_list=all_formats, importable_formats=importable_formats, exportable_formats=exportable_formats) fh.write(rendered) +def cleanup_rst(app, exception): + if hasattr(app, 'formats_rst_dir') and \ + os.path.exists(app.formats_rst_dir): + shutil.rmtree(app.formats_rst_dir) + + def setup(app): app.connect('builder-inited', generate_rst) return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/formats/templates/format-list.rst b/source/sphinx_extensions/formats/templates/formats-list.rst similarity index 92% rename from source/sphinx_extensions/formats/templates/format-list.rst rename to source/sphinx_extensions/formats/templates/formats-list.rst index 165c5af4..46c53e76 100644 --- a/source/sphinx_extensions/formats/templates/format-list.rst +++ b/source/sphinx_extensions/formats/templates/formats-list.rst @@ -1,6 +1,8 @@ Formats List ============ +All Formats +----------- {% for format in format_list %} - {{ format }} {% endfor %} diff --git a/source/sphinx_extensions/transformers/extension.py b/source/sphinx_extensions/transformers/extension.py index f60ea863..3790ba96 100644 --- a/source/sphinx_extensions/transformers/extension.py +++ b/source/sphinx_extensions/transformers/extension.py @@ -7,6 +7,7 @@ # ---------------------------------------------------------------------------- import os +import shutil import jinja2 import qiime2.sdk @@ -23,12 +24,53 @@ def generate_rst(app): 'sphinx_extensions.transformers', 'templates') env = jinja2.Environment(loader=loader) - template = env.get_template('transformers.rst') - with open(os.path.join(app.env.srcdir, 'transformers.rst'), 'w') as fh: - rendered = template.render(plugin_manager=pm) + rst_dir = os.path.join(app.env.srcdir, 'transformers-list') + app.transformers_rst_dir = rst_dir + cleanup_rst(app, None) + os.mkdir(rst_dir) + + index_path = os.path.join(rst_dir, 'transformers-list.rst') + + transformers_list = [] + for from_type in pm.transformers: + for to_type in pm.transformers[from_type]: + from_type = qiime2.core.util.get_view_name(from_type) + to_type = qiime2.core.util.get_view_name(to_type) + transformers_list.append((from_type, to_type)) + + # .upper() because Python sorts all capitalized elements above all + # lowercase ones, and I figured we didn't want 'dict' sorting under + # 'TaxonomicClassifierDirFmt' + transformers_list.sort( + key=lambda element: (element[0].upper(), element[1].upper())) + + reverse_transformers_list = [] + for to_type in pm._reverse_transformers: + for from_type in pm.transformers[to_type]: + from_type = qiime2.core.util.get_view_name(to_type) + to_type = qiime2.core.util.get_view_name(from_type) + reverse_transformers_list.append((from_type, to_type)) + + # .upper() because Python sorts all capitalized elements above all + # lowercase ones, and I figured we didn't want 'dict' sorting under + # 'TaxonomicClassifierDirFmt' + reverse_transformers_list.sort( + key=lambda element: (element[0].upper(), element[1].upper())) + + template = env.get_template('transformers-list.rst') + with open(index_path, 'w') as fh: + rendered = template.render( + transformers_list=transformers_list, + reverse_transformers_list=reverse_transformers_list) fh.write(rendered) +def cleanup_rst(app, exception): + if hasattr(app, 'transformers_rst_dir') and \ + os.path.exists(app.transformers_rst_dir): + shutil.rmtree(app.transformers_rst_dir) + + def setup(app): app.connect('builder-inited', generate_rst) return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/transformers/templates/transformers-list.rst b/source/sphinx_extensions/transformers/templates/transformers-list.rst new file mode 100644 index 00000000..0d51041f --- /dev/null +++ b/source/sphinx_extensions/transformers/templates/transformers-list.rst @@ -0,0 +1,14 @@ +Transformers +============ + +Transformers +------------ +{% for from, to in transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} + +Reverse Transformers +-------------------- +{% for from, to in reverse_transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} \ No newline at end of file diff --git a/source/sphinx_extensions/transformers/templates/transformers.rst b/source/sphinx_extensions/transformers/templates/transformers.rst deleted file mode 100644 index 9a7f5f00..00000000 --- a/source/sphinx_extensions/transformers/templates/transformers.rst +++ /dev/null @@ -1,12 +0,0 @@ -Transformers -============ - -{% for transfomer in plugin_manager.transformers %} -- {{ transfomer }} -{% endfor %} - -Reverse Transformers --------------------- -{% for reverse_transformer in plugin_manager._reverse_transformers %} -- {{ reverse_transformer }} -{% endfor %} \ No newline at end of file diff --git a/source/sphinx_extensions/types/extension.py b/source/sphinx_extensions/types/extension.py index 23f6da66..7a6ae217 100644 --- a/source/sphinx_extensions/types/extension.py +++ b/source/sphinx_extensions/types/extension.py @@ -9,6 +9,8 @@ import jinja2 import qiime2.sdk import qiime2.core +import os +import shutil from sphinx.util import logging logger = logging.getLogger(__name__) @@ -17,22 +19,33 @@ def generate_rst(app): pm = qiime2.sdk.PluginManager() - loader = jinja2.PackageLoader('sphinx_extensions.types', - 'templates') + loader = jinja2.PackageLoader('sphinx_extensions.types', 'templates') env = jinja2.Environment(loader=loader) - type_list = [] + rst_dir = os.path.join(app.env.srcdir, 'types-list') + app.types_rst_dir = rst_dir + cleanup_rst(app, None) + os.mkdir(rst_dir) + + index_path = os.path.join(rst_dir, 'types-list.rst') + type_list = [] for type in pm.get_semantic_types(): type_list.append(repr(type)) type_list.sort() template = env.get_template('types-list.rst') - with open('types_list.rst', 'w') as fh: + with open(index_path, 'w') as fh: rendered = template.render(type_list=type_list) fh.write(rendered) +def cleanup_rst(app, exception): + if hasattr(app, 'types_rst_dir') and \ + os.path.exists(app.types_rst_dir): + shutil.rmtree(app.types_rst_dir) + + def setup(app): app.connect('builder-inited', generate_rst) return {'version': '0.0.1'} diff --git a/source/transformers-list/transformers-list.rst b/source/transformers-list/transformers-list.rst new file mode 100644 index 00000000..c0610198 --- /dev/null +++ b/source/transformers-list/transformers-list.rst @@ -0,0 +1,391 @@ +Transformers +============ + +Transformers +------------ + +- AlignedDNAFASTAFormat -> skbio.alignment._tabular_msa:TabularMSA + +- AlphaDiversityFormat -> pandas.core.series:Series + +- biom.table:Table -> BIOMV210Format + +- BIOMV100Format -> biom.table:Table + +- BIOMV210Format -> pandas.core.frame:DataFrame + +- BooleanSeriesFormat -> pandas.core.series:Series + +- builtins:dict -> JSONFormat + +- builtins:str -> biom.table:Table + +- builtins:str -> BIOMV210Format + +- builtins:str -> BIOMV210Format + +- builtins:str -> BooleanSeriesFormat + +- builtins:str -> DeblurStatsFmt + +- builtins:str -> DifferentialFormat + +- builtins:str -> DNAFASTAFormat + +- builtins:str -> ErrorCorrectionDetailsFmt + +- builtins:str -> FirstDifferencesFormat + +- builtins:str -> ImportanceFormat + +- builtins:str -> JSONFormat + +- builtins:str -> pandas.core.frame:DataFrame + +- builtins:str -> pandas.core.frame:DataFrame + +- builtins:str -> pandas.core.frame:DataFrame + +- builtins:str -> pandas.core.series:Series + +- builtins:str -> pandas.core.series:Series + +- builtins:str -> pandas.core.series:Series + +- builtins:str -> PlacementsFormat + +- builtins:str -> PredictionsFormat + +- builtins:str -> ProbabilitiesFormat + +- builtins:str -> q2_demux._demux:BarcodeSequenceFastqIterator + +- builtins:str -> q2_demux._summarize._visualizer:_PlotQualView + +- builtins:str -> q2_demux._summarize._visualizer:_PlotQualView + +- builtins:str -> q2_types.feature_data._transformer:AlignedDNAIterator + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> qiime2.metadata.metadata:Metadata + +- builtins:str -> QualityFilterStatsFmt + +- builtins:str -> SingleLanePerSamplePairedEndFastqDirFmt + +- builtins:str -> SingleLanePerSamplePairedEndFastqDirFmt + +- builtins:str -> TaxonomicClassiferTemporaryPickleDirFmt + +- builtins:str -> TSVTaxonomyFormat + +- builtins:str -> TSVTaxonomyFormat + +- builtins:str -> TSVTaxonomyFormat + +- builtins:str -> TSVTaxonomyFormat + +- CasavaOneEightLanelessPerSampleDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt + +- CasavaOneEightSingleLanePerSampleDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt + +- DADA2StatsFormat -> qiime2.metadata.metadata:Metadata + +- DeblurStatsFmt -> pandas.core.frame:DataFrame + +- DifferentialFormat -> pandas.core.frame:DataFrame + +- DNAFASTAFormat -> q2_types.feature_data._transformer:DNAIterator + +- EMPMultiplexedDirFmt -> q2_demux._demux:BarcodeSequenceFastqIterator + +- EMPPairedEndCasavaDirFmt -> EMPPairedEndDirFmt + +- EMPPairedEndDirFmt -> q2_demux._demux:BarcodePairedSequenceFastqIterator + +- EMPSingleEndCasavaDirFmt -> EMPSingleEndDirFmt + +- EMPSingleEndDirFmt -> q2_demux._demux:BarcodeSequenceFastqIterator + +- ErrorCorrectionDetailsFmt -> pandas.core.frame:DataFrame + +- FastqManifestFormat -> pandas.core.frame:DataFrame + +- FirstDifferencesFormat -> pandas.core.series:Series + +- HeaderlessTSVTaxonomyFormat -> TSVTaxonomyFormat + +- ImportanceFormat -> pandas.core.frame:DataFrame + +- JSONFormat -> builtins:dict + +- JSONFormat -> builtins:dict + +- LSMatFormat -> skbio.stats.distance._base:DistanceMatrix + +- NewickFormat -> skbio.tree._tree:TreeNode + +- OrdinationFormat -> skbio.stats.ordination._ordination_results:OrdinationResults + +- PairedDNASequencesDirectoryFormat -> q2_types.feature_data._transformer:PairedDNAIterator + +- PairedEndFastqManifestPhred33 -> SingleLanePerSamplePairedEndFastqDirFmt + +- PairedEndFastqManifestPhred33V2 -> SingleLanePerSamplePairedEndFastqDirFmt + +- PairedEndFastqManifestPhred64 -> SingleLanePerSamplePairedEndFastqDirFmt + +- PairedEndFastqManifestPhred64V2 -> SingleLanePerSamplePairedEndFastqDirFmt + +- pandas.core.frame:DataFrame -> biom.table:Table + +- pandas.core.series:Series -> AlphaDiversityFormat + +- PlacementsFormat -> builtins:dict + +- PredictionsFormat -> pandas.core.series:Series + +- ProbabilitiesFormat -> pandas.core.frame:DataFrame + +- q2_types.feature_data._transformer:AlignedDNAIterator -> AlignedDNAFASTAFormat + +- q2_types.feature_data._transformer:DNAIterator -> DNAFASTAFormat + +- q2_types.feature_data._transformer:PairedDNAIterator -> PairedDNASequencesDirectoryFormat + +- qiime2.metadata.metadata:Metadata -> DADA2StatsFormat + +- QualityFilterStatsFmt -> pandas.core.frame:DataFrame + +- SampleEstimatorDirFmt -> sklearn.pipeline:Pipeline + +- SingleEndFastqManifestPhred33 -> SingleLanePerSampleSingleEndFastqDirFmt + +- SingleEndFastqManifestPhred33V2 -> SingleLanePerSampleSingleEndFastqDirFmt + +- SingleEndFastqManifestPhred64 -> SingleLanePerSampleSingleEndFastqDirFmt + +- SingleEndFastqManifestPhred64V2 -> SingleLanePerSampleSingleEndFastqDirFmt + +- SingleLanePerSamplePairedEndFastqDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt + +- SingleLanePerSampleSingleEndFastqDirFmt -> QIIME1DemuxDirFmt + +- skbio.alignment._tabular_msa:TabularMSA -> AlignedDNAFASTAFormat + +- skbio.stats.distance._base:DistanceMatrix -> LSMatFormat + +- skbio.stats.ordination._ordination_results:OrdinationResults -> OrdinationFormat + +- skbio.tree._tree:TreeNode -> NewickFormat + +- sklearn.pipeline:Pipeline -> SampleEstimatorDirFmt + +- TaxonomicClassiferTemporaryPickleDirFmt -> sklearn.pipeline:Pipeline + +- TaxonomicClassifierDirFmt -> sklearn.pipeline:Pipeline + +- TaxonomyFormat -> pandas.core.frame:DataFrame + +- TSVTaxonomyFormat -> pandas.core.frame:DataFrame + +- UchimeStatsFmt -> qiime2.metadata.metadata:Metadata + + +Reverse Transformers +-------------------- + +- AlignedDNAFASTAFormat -> builtins:str + +- AlphaDiversityFormat -> builtins:str + +- biom.table:Table -> builtins:str + +- BIOMV210Format -> builtins:str + +- BooleanSeriesFormat -> builtins:str + +- builtins:dict -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- builtins:str -> builtins:str + +- DADA2StatsFormat -> builtins:str + +- DeblurStatsFmt -> builtins:str + +- DifferentialFormat -> builtins:str + +- DNAFASTAFormat -> builtins:str + +- EMPPairedEndDirFmt -> builtins:str + +- EMPSingleEndDirFmt -> builtins:str + +- ErrorCorrectionDetailsFmt -> builtins:str + +- FirstDifferencesFormat -> builtins:str + +- ImportanceFormat -> builtins:str + +- JSONFormat -> builtins:str + +- JSONFormat -> builtins:str + +- LSMatFormat -> builtins:str + +- NewickFormat -> builtins:str + +- OrdinationFormat -> builtins:str + +- PairedDNASequencesDirectoryFormat -> builtins:str + +- pandas.core.frame:DataFrame -> builtins:str + +- pandas.core.series:Series -> builtins:str + +- PlacementsFormat -> builtins:str + +- PredictionsFormat -> builtins:str + +- ProbabilitiesFormat -> builtins:str + +- q2_types.feature_data._transformer:AlignedDNAIterator -> builtins:str + +- q2_types.feature_data._transformer:DNAIterator -> builtins:str + +- q2_types.feature_data._transformer:PairedDNAIterator -> builtins:str + +- qiime2.metadata.metadata:Metadata -> builtins:str + +- QualityFilterStatsFmt -> builtins:str + +- SampleEstimatorDirFmt -> builtins:str + +- SingleLanePerSamplePairedEndFastqDirFmt -> builtins:str + +- SingleLanePerSampleSingleEndFastqDirFmt -> builtins:str + +- skbio.alignment._tabular_msa:TabularMSA -> builtins:str + +- skbio.stats.distance._base:DistanceMatrix -> builtins:str + +- skbio.stats.ordination._ordination_results:OrdinationResults -> builtins:str + +- skbio.tree._tree:TreeNode -> builtins:str + +- sklearn.pipeline:Pipeline -> builtins:str + +- TaxonomicClassiferTemporaryPickleDirFmt -> builtins:str + +- TSVTaxonomyFormat -> builtins:str diff --git a/source/transformers.rst b/source/transformers.rst deleted file mode 100644 index ee4854f9..00000000 --- a/source/transformers.rst +++ /dev/null @@ -1,307 +0,0 @@ -Transformers -============ - - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Reverse Transformers --------------------- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- diff --git a/source/types-list.rst b/source/types-list/types-list.rst similarity index 100% rename from source/types-list.rst rename to source/types-list/types-list.rst diff --git a/types_list.rst b/types_list.rst deleted file mode 100644 index 08e666ea..00000000 --- a/types_list.rst +++ /dev/null @@ -1,85 +0,0 @@ -Types list -========== - - -- DeblurStats - -- DistanceMatrix - -- EMPPairedEndSequences - -- EMPSingleEndSequences - -- ErrorCorrectionDetails - -- FeatureData[AlignedSequence] - -- FeatureData[Differential] - -- FeatureData[Importance] - -- FeatureData[PairedEndSequence] - -- FeatureData[Sequence] - -- FeatureData[Taxonomy] - -- FeatureTable[Balance] - -- FeatureTable[Composition] - -- FeatureTable[Frequency] - -- FeatureTable[PercentileNormalized] - -- FeatureTable[PresenceAbsence] - -- FeatureTable[RelativeFrequency] - -- Hierarchy - -- MultiplexedPairedEndBarcodeInSequence - -- MultiplexedSingleEndBarcodeInSequence - -- PCoAResults - -- Phylogeny[Rooted] - -- Phylogeny[Unrooted] - -- Placements - -- QualityFilterStats - -- RawSequences - -- SampleData[AlphaDiversity] - -- SampleData[BooleanSeries] - -- SampleData[ClassifierPredictions] - -- SampleData[DADA2Stats] - -- SampleData[FirstDifferences] - -- SampleData[JoinedSequencesWithQuality] - -- SampleData[PairedEndSequencesWithQuality] - -- SampleData[Probabilities] - -- SampleData[RegressorPredictions] - -- SampleData[SequencesWithQuality] - -- SampleData[Sequences] - -- SampleEstimator[Classifier] - -- SampleEstimator[Regressor] - -- TaxonomicClassifier - -- UchimeStats From 971b3d023f32ca63acf8784213dfd144312bcfd7 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 7 Nov 2019 15:18:35 -0700 Subject: [PATCH 07/10] SQUASH: Some reworking of the types, formats, and transformers --- source/conf.py | 4 +- source/formats-list/formats-list.rst | 153 ------- source/index.rst | 4 +- source/sphinx_extensions/formats/extension.py | 62 --- .../formats/templates/formats-list.rst | 20 - .../transformers/__init__.py | 11 - .../templates/transformers-list.rst | 14 - .../__init__.py | 0 .../extension.py | 46 ++- .../types-formats-transformers-list.rst | 42 ++ source/sphinx_extensions/types/__init__.py | 11 - source/sphinx_extensions/types/extension.py | 51 --- .../types/templates/types-list.rst | 6 - .../transformers-list/transformers-list.rst | 391 ------------------ source/types-list/types-list.rst | 85 ---- 15 files changed, 79 insertions(+), 821 deletions(-) delete mode 100644 source/formats-list/formats-list.rst delete mode 100644 source/sphinx_extensions/formats/extension.py delete mode 100644 source/sphinx_extensions/formats/templates/formats-list.rst delete mode 100644 source/sphinx_extensions/transformers/__init__.py delete mode 100644 source/sphinx_extensions/transformers/templates/transformers-list.rst rename source/sphinx_extensions/{formats => types-formats-transformers}/__init__.py (100%) rename source/sphinx_extensions/{transformers => types-formats-transformers}/extension.py (62%) create mode 100644 source/sphinx_extensions/types-formats-transformers/templates/types-formats-transformers-list.rst delete mode 100644 source/sphinx_extensions/types/__init__.py delete mode 100644 source/sphinx_extensions/types/extension.py delete mode 100644 source/sphinx_extensions/types/templates/types-list.rst delete mode 100644 source/transformers-list/transformers-list.rst delete mode 100644 source/types-list/types-list.rst diff --git a/source/conf.py b/source/conf.py index a1d4c596..2c1fbe09 100644 --- a/source/conf.py +++ b/source/conf.py @@ -56,9 +56,7 @@ 'sphinx_extensions.plugin_directory', 'sphinx_extensions.external_links', 'sphinxcontrib.bibtex', - 'sphinx_extensions.types', - 'sphinx_extensions.formats', - 'sphinx_extensions.transformers' + 'sphinx_extensions.types-formats-transformers' ] # Add any paths that contain templates here, relative to this directory. diff --git a/source/formats-list/formats-list.rst b/source/formats-list/formats-list.rst deleted file mode 100644 index a03bec0a..00000000 --- a/source/formats-list/formats-list.rst +++ /dev/null @@ -1,153 +0,0 @@ -Formats List -============ - -All Formats ------------ - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - -- "" - - -Importable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - -Exportable Formats ------------------- - -- - -- - -- - -- - -- - -- - -- diff --git a/source/index.rst b/source/index.rst index 190843e0..535ae3b4 100644 --- a/source/index.rst +++ b/source/index.rst @@ -22,9 +22,7 @@ Table of contents interfaces/index plugins/index semantic-types - types-list/types-list - formats-list/formats-list - transformers-list/transformers-list + types-formats-transformers-list/types-formats-transformers-list community data-resources supplementary-resources diff --git a/source/sphinx_extensions/formats/extension.py b/source/sphinx_extensions/formats/extension.py deleted file mode 100644 index 389d23b9..00000000 --- a/source/sphinx_extensions/formats/extension.py +++ /dev/null @@ -1,62 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2016-2019, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- - -import os -import shutil - -import jinja2 -import qiime2.sdk -import qiime2.core - -from sphinx.util import logging -logger = logging.getLogger(__name__) - - -def generate_rst(app): - pm = qiime2.sdk.PluginManager() - - loader = jinja2.PackageLoader('sphinx_extensions.formats', 'templates') - env = jinja2.Environment(loader=loader) - - rst_dir = os.path.join(app.env.srcdir, 'formats-list') - app.formats_rst_dir = rst_dir - cleanup_rst(app, None) - os.mkdir(rst_dir) - - index_path = os.path.join(rst_dir, 'formats-list.rst') - - importable_formats = [ - repr(importable_format) for importable_format in pm._importable] - importable_formats.sort() - - exportable_formats = [ - repr(exportable_format) for exportable_format in pm._exportable] - exportable_formats.sort() - - all_formats_set = {*importable_formats, *exportable_formats, - *[repr(format) for format in pm._canonical_formats]} - all_formats = [repr(format) for format in all_formats_set] - all_formats.sort() - - template = env.get_template('formats-list.rst') - with open(index_path, 'w') as fh: - rendered = template.render(format_list=all_formats, - importable_formats=importable_formats, - exportable_formats=exportable_formats) - fh.write(rendered) - - -def cleanup_rst(app, exception): - if hasattr(app, 'formats_rst_dir') and \ - os.path.exists(app.formats_rst_dir): - shutil.rmtree(app.formats_rst_dir) - - -def setup(app): - app.connect('builder-inited', generate_rst) - return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/formats/templates/formats-list.rst b/source/sphinx_extensions/formats/templates/formats-list.rst deleted file mode 100644 index 46c53e76..00000000 --- a/source/sphinx_extensions/formats/templates/formats-list.rst +++ /dev/null @@ -1,20 +0,0 @@ -Formats List -============ - -All Formats ------------ -{% for format in format_list %} -- {{ format }} -{% endfor %} - -Importable Formats ------------------- -{% for imp in importable_formats %} -- {{ imp }} -{% endfor %} - -Exportable Formats ------------------- -{% for exp in exportable_formats %} -- {{ exp }} -{% endfor %} diff --git a/source/sphinx_extensions/transformers/__init__.py b/source/sphinx_extensions/transformers/__init__.py deleted file mode 100644 index deccba06..00000000 --- a/source/sphinx_extensions/transformers/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2016-2019, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- - -from .extension import setup - -__all__ = ['setup'] diff --git a/source/sphinx_extensions/transformers/templates/transformers-list.rst b/source/sphinx_extensions/transformers/templates/transformers-list.rst deleted file mode 100644 index 0d51041f..00000000 --- a/source/sphinx_extensions/transformers/templates/transformers-list.rst +++ /dev/null @@ -1,14 +0,0 @@ -Transformers -============ - -Transformers ------------- -{% for from, to in transformers_list %} -- {{ from }} -> {{ to }} -{% endfor %} - -Reverse Transformers --------------------- -{% for from, to in reverse_transformers_list %} -- {{ from }} -> {{ to }} -{% endfor %} \ No newline at end of file diff --git a/source/sphinx_extensions/formats/__init__.py b/source/sphinx_extensions/types-formats-transformers/__init__.py similarity index 100% rename from source/sphinx_extensions/formats/__init__.py rename to source/sphinx_extensions/types-formats-transformers/__init__.py diff --git a/source/sphinx_extensions/transformers/extension.py b/source/sphinx_extensions/types-formats-transformers/extension.py similarity index 62% rename from source/sphinx_extensions/transformers/extension.py rename to source/sphinx_extensions/types-formats-transformers/extension.py index 3790ba96..b25fa666 100644 --- a/source/sphinx_extensions/transformers/extension.py +++ b/source/sphinx_extensions/types-formats-transformers/extension.py @@ -6,12 +6,11 @@ # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- -import os -import shutil - import jinja2 import qiime2.sdk import qiime2.core +import os +import shutil from sphinx.util import logging logger = logging.getLogger(__name__) @@ -21,15 +20,35 @@ def generate_rst(app): pm = qiime2.sdk.PluginManager() loader = jinja2.PackageLoader( - 'sphinx_extensions.transformers', 'templates') + 'sphinx_extensions.types-formats-transformers', 'templates') env = jinja2.Environment(loader=loader) - rst_dir = os.path.join(app.env.srcdir, 'transformers-list') - app.transformers_rst_dir = rst_dir + rst_dir = os.path.join(app.env.srcdir, 'types-formats-transformers-list') + app.types_rst_dir = rst_dir cleanup_rst(app, None) os.mkdir(rst_dir) - index_path = os.path.join(rst_dir, 'transformers-list.rst') + index_path = os.path.join(rst_dir, 'types-formats-transformers-list.rst') + + type_list = [] + for type in pm.get_semantic_types(): + type_list.append(repr(type)) + + importable_formats = [ + repr(importable_format) for importable_format + in pm.get_formats(importable=True)] + importable_formats.sort() + + exportable_formats = [ + repr(exportable_format) for exportable_format + in pm.get_formats(exportable=True)] + exportable_formats.sort() + + all_formats_set = {*importable_formats, *exportable_formats, + *[repr(format) for format + in pm.get_formats(include_all=True)]} + all_formats = [repr(format) for format in all_formats_set] + all_formats.sort() transformers_list = [] for from_type in pm.transformers: @@ -57,20 +76,25 @@ def generate_rst(app): reverse_transformers_list.sort( key=lambda element: (element[0].upper(), element[1].upper())) - template = env.get_template('transformers-list.rst') + type_list.sort() + template = env.get_template('types-formats-transformers-list.rst') with open(index_path, 'w') as fh: rendered = template.render( + type_list=type_list, format_list=all_formats, + importable_formats=importable_formats, + exportable_formats=exportable_formats, transformers_list=transformers_list, reverse_transformers_list=reverse_transformers_list) fh.write(rendered) def cleanup_rst(app, exception): - if hasattr(app, 'transformers_rst_dir') and \ - os.path.exists(app.transformers_rst_dir): - shutil.rmtree(app.transformers_rst_dir) + if hasattr(app, 'types_rst_dir') and \ + os.path.exists(app.types_rst_dir): + shutil.rmtree(app.types_rst_dir) def setup(app): app.connect('builder-inited', generate_rst) + app.connect('build-finished', cleanup_rst) return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/types-formats-transformers/templates/types-formats-transformers-list.rst b/source/sphinx_extensions/types-formats-transformers/templates/types-formats-transformers-list.rst new file mode 100644 index 00000000..f817ddf9 --- /dev/null +++ b/source/sphinx_extensions/types-formats-transformers/templates/types-formats-transformers-list.rst @@ -0,0 +1,42 @@ +Types List +========== + +{% for type in type_list %} +- {{ type }} +{% endfor %} + +Formats List +============ + +All Formats +----------- +{% for format in format_list %} +- {{ format }} +{% endfor %} + +Importable Formats +------------------ +{% for imp in importable_formats %} +- {{ imp }} +{% endfor %} + +Exportable Formats +------------------ +{% for exp in exportable_formats %} +- {{ exp }} +{% endfor %} + +Transformers +============ + +Transformers +------------ +{% for from, to in transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} + +Reverse Transformers +-------------------- +{% for from, to in reverse_transformers_list %} +- {{ from }} -> {{ to }} +{% endfor %} diff --git a/source/sphinx_extensions/types/__init__.py b/source/sphinx_extensions/types/__init__.py deleted file mode 100644 index deccba06..00000000 --- a/source/sphinx_extensions/types/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2016-2019, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- - -from .extension import setup - -__all__ = ['setup'] diff --git a/source/sphinx_extensions/types/extension.py b/source/sphinx_extensions/types/extension.py deleted file mode 100644 index 7a6ae217..00000000 --- a/source/sphinx_extensions/types/extension.py +++ /dev/null @@ -1,51 +0,0 @@ -# ---------------------------------------------------------------------------- -# Copyright (c) 2016-2019, QIIME 2 development team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file LICENSE, distributed with this software. -# ---------------------------------------------------------------------------- - -import jinja2 -import qiime2.sdk -import qiime2.core -import os -import shutil - -from sphinx.util import logging -logger = logging.getLogger(__name__) - - -def generate_rst(app): - pm = qiime2.sdk.PluginManager() - - loader = jinja2.PackageLoader('sphinx_extensions.types', 'templates') - env = jinja2.Environment(loader=loader) - - rst_dir = os.path.join(app.env.srcdir, 'types-list') - app.types_rst_dir = rst_dir - cleanup_rst(app, None) - os.mkdir(rst_dir) - - index_path = os.path.join(rst_dir, 'types-list.rst') - - type_list = [] - for type in pm.get_semantic_types(): - type_list.append(repr(type)) - - type_list.sort() - template = env.get_template('types-list.rst') - with open(index_path, 'w') as fh: - rendered = template.render(type_list=type_list) - fh.write(rendered) - - -def cleanup_rst(app, exception): - if hasattr(app, 'types_rst_dir') and \ - os.path.exists(app.types_rst_dir): - shutil.rmtree(app.types_rst_dir) - - -def setup(app): - app.connect('builder-inited', generate_rst) - return {'version': '0.0.1'} diff --git a/source/sphinx_extensions/types/templates/types-list.rst b/source/sphinx_extensions/types/templates/types-list.rst deleted file mode 100644 index 47d433ed..00000000 --- a/source/sphinx_extensions/types/templates/types-list.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types list -========== - -{% for type in type_list %} -- {{ type }} -{% endfor %} diff --git a/source/transformers-list/transformers-list.rst b/source/transformers-list/transformers-list.rst deleted file mode 100644 index c0610198..00000000 --- a/source/transformers-list/transformers-list.rst +++ /dev/null @@ -1,391 +0,0 @@ -Transformers -============ - -Transformers ------------- - -- AlignedDNAFASTAFormat -> skbio.alignment._tabular_msa:TabularMSA - -- AlphaDiversityFormat -> pandas.core.series:Series - -- biom.table:Table -> BIOMV210Format - -- BIOMV100Format -> biom.table:Table - -- BIOMV210Format -> pandas.core.frame:DataFrame - -- BooleanSeriesFormat -> pandas.core.series:Series - -- builtins:dict -> JSONFormat - -- builtins:str -> biom.table:Table - -- builtins:str -> BIOMV210Format - -- builtins:str -> BIOMV210Format - -- builtins:str -> BooleanSeriesFormat - -- builtins:str -> DeblurStatsFmt - -- builtins:str -> DifferentialFormat - -- builtins:str -> DNAFASTAFormat - -- builtins:str -> ErrorCorrectionDetailsFmt - -- builtins:str -> FirstDifferencesFormat - -- builtins:str -> ImportanceFormat - -- builtins:str -> JSONFormat - -- builtins:str -> pandas.core.frame:DataFrame - -- builtins:str -> pandas.core.frame:DataFrame - -- builtins:str -> pandas.core.frame:DataFrame - -- builtins:str -> pandas.core.series:Series - -- builtins:str -> pandas.core.series:Series - -- builtins:str -> pandas.core.series:Series - -- builtins:str -> PlacementsFormat - -- builtins:str -> PredictionsFormat - -- builtins:str -> ProbabilitiesFormat - -- builtins:str -> q2_demux._demux:BarcodeSequenceFastqIterator - -- builtins:str -> q2_demux._summarize._visualizer:_PlotQualView - -- builtins:str -> q2_demux._summarize._visualizer:_PlotQualView - -- builtins:str -> q2_types.feature_data._transformer:AlignedDNAIterator - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> qiime2.metadata.metadata:Metadata - -- builtins:str -> QualityFilterStatsFmt - -- builtins:str -> SingleLanePerSamplePairedEndFastqDirFmt - -- builtins:str -> SingleLanePerSamplePairedEndFastqDirFmt - -- builtins:str -> TaxonomicClassiferTemporaryPickleDirFmt - -- builtins:str -> TSVTaxonomyFormat - -- builtins:str -> TSVTaxonomyFormat - -- builtins:str -> TSVTaxonomyFormat - -- builtins:str -> TSVTaxonomyFormat - -- CasavaOneEightLanelessPerSampleDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt - -- CasavaOneEightSingleLanePerSampleDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt - -- DADA2StatsFormat -> qiime2.metadata.metadata:Metadata - -- DeblurStatsFmt -> pandas.core.frame:DataFrame - -- DifferentialFormat -> pandas.core.frame:DataFrame - -- DNAFASTAFormat -> q2_types.feature_data._transformer:DNAIterator - -- EMPMultiplexedDirFmt -> q2_demux._demux:BarcodeSequenceFastqIterator - -- EMPPairedEndCasavaDirFmt -> EMPPairedEndDirFmt - -- EMPPairedEndDirFmt -> q2_demux._demux:BarcodePairedSequenceFastqIterator - -- EMPSingleEndCasavaDirFmt -> EMPSingleEndDirFmt - -- EMPSingleEndDirFmt -> q2_demux._demux:BarcodeSequenceFastqIterator - -- ErrorCorrectionDetailsFmt -> pandas.core.frame:DataFrame - -- FastqManifestFormat -> pandas.core.frame:DataFrame - -- FirstDifferencesFormat -> pandas.core.series:Series - -- HeaderlessTSVTaxonomyFormat -> TSVTaxonomyFormat - -- ImportanceFormat -> pandas.core.frame:DataFrame - -- JSONFormat -> builtins:dict - -- JSONFormat -> builtins:dict - -- LSMatFormat -> skbio.stats.distance._base:DistanceMatrix - -- NewickFormat -> skbio.tree._tree:TreeNode - -- OrdinationFormat -> skbio.stats.ordination._ordination_results:OrdinationResults - -- PairedDNASequencesDirectoryFormat -> q2_types.feature_data._transformer:PairedDNAIterator - -- PairedEndFastqManifestPhred33 -> SingleLanePerSamplePairedEndFastqDirFmt - -- PairedEndFastqManifestPhred33V2 -> SingleLanePerSamplePairedEndFastqDirFmt - -- PairedEndFastqManifestPhred64 -> SingleLanePerSamplePairedEndFastqDirFmt - -- PairedEndFastqManifestPhred64V2 -> SingleLanePerSamplePairedEndFastqDirFmt - -- pandas.core.frame:DataFrame -> biom.table:Table - -- pandas.core.series:Series -> AlphaDiversityFormat - -- PlacementsFormat -> builtins:dict - -- PredictionsFormat -> pandas.core.series:Series - -- ProbabilitiesFormat -> pandas.core.frame:DataFrame - -- q2_types.feature_data._transformer:AlignedDNAIterator -> AlignedDNAFASTAFormat - -- q2_types.feature_data._transformer:DNAIterator -> DNAFASTAFormat - -- q2_types.feature_data._transformer:PairedDNAIterator -> PairedDNASequencesDirectoryFormat - -- qiime2.metadata.metadata:Metadata -> DADA2StatsFormat - -- QualityFilterStatsFmt -> pandas.core.frame:DataFrame - -- SampleEstimatorDirFmt -> sklearn.pipeline:Pipeline - -- SingleEndFastqManifestPhred33 -> SingleLanePerSampleSingleEndFastqDirFmt - -- SingleEndFastqManifestPhred33V2 -> SingleLanePerSampleSingleEndFastqDirFmt - -- SingleEndFastqManifestPhred64 -> SingleLanePerSampleSingleEndFastqDirFmt - -- SingleEndFastqManifestPhred64V2 -> SingleLanePerSampleSingleEndFastqDirFmt - -- SingleLanePerSamplePairedEndFastqDirFmt -> SingleLanePerSampleSingleEndFastqDirFmt - -- SingleLanePerSampleSingleEndFastqDirFmt -> QIIME1DemuxDirFmt - -- skbio.alignment._tabular_msa:TabularMSA -> AlignedDNAFASTAFormat - -- skbio.stats.distance._base:DistanceMatrix -> LSMatFormat - -- skbio.stats.ordination._ordination_results:OrdinationResults -> OrdinationFormat - -- skbio.tree._tree:TreeNode -> NewickFormat - -- sklearn.pipeline:Pipeline -> SampleEstimatorDirFmt - -- TaxonomicClassiferTemporaryPickleDirFmt -> sklearn.pipeline:Pipeline - -- TaxonomicClassifierDirFmt -> sklearn.pipeline:Pipeline - -- TaxonomyFormat -> pandas.core.frame:DataFrame - -- TSVTaxonomyFormat -> pandas.core.frame:DataFrame - -- UchimeStatsFmt -> qiime2.metadata.metadata:Metadata - - -Reverse Transformers --------------------- - -- AlignedDNAFASTAFormat -> builtins:str - -- AlphaDiversityFormat -> builtins:str - -- biom.table:Table -> builtins:str - -- BIOMV210Format -> builtins:str - -- BooleanSeriesFormat -> builtins:str - -- builtins:dict -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- builtins:str -> builtins:str - -- DADA2StatsFormat -> builtins:str - -- DeblurStatsFmt -> builtins:str - -- DifferentialFormat -> builtins:str - -- DNAFASTAFormat -> builtins:str - -- EMPPairedEndDirFmt -> builtins:str - -- EMPSingleEndDirFmt -> builtins:str - -- ErrorCorrectionDetailsFmt -> builtins:str - -- FirstDifferencesFormat -> builtins:str - -- ImportanceFormat -> builtins:str - -- JSONFormat -> builtins:str - -- JSONFormat -> builtins:str - -- LSMatFormat -> builtins:str - -- NewickFormat -> builtins:str - -- OrdinationFormat -> builtins:str - -- PairedDNASequencesDirectoryFormat -> builtins:str - -- pandas.core.frame:DataFrame -> builtins:str - -- pandas.core.series:Series -> builtins:str - -- PlacementsFormat -> builtins:str - -- PredictionsFormat -> builtins:str - -- ProbabilitiesFormat -> builtins:str - -- q2_types.feature_data._transformer:AlignedDNAIterator -> builtins:str - -- q2_types.feature_data._transformer:DNAIterator -> builtins:str - -- q2_types.feature_data._transformer:PairedDNAIterator -> builtins:str - -- qiime2.metadata.metadata:Metadata -> builtins:str - -- QualityFilterStatsFmt -> builtins:str - -- SampleEstimatorDirFmt -> builtins:str - -- SingleLanePerSamplePairedEndFastqDirFmt -> builtins:str - -- SingleLanePerSampleSingleEndFastqDirFmt -> builtins:str - -- skbio.alignment._tabular_msa:TabularMSA -> builtins:str - -- skbio.stats.distance._base:DistanceMatrix -> builtins:str - -- skbio.stats.ordination._ordination_results:OrdinationResults -> builtins:str - -- skbio.tree._tree:TreeNode -> builtins:str - -- sklearn.pipeline:Pipeline -> builtins:str - -- TaxonomicClassiferTemporaryPickleDirFmt -> builtins:str - -- TSVTaxonomyFormat -> builtins:str diff --git a/source/types-list/types-list.rst b/source/types-list/types-list.rst deleted file mode 100644 index 08e666ea..00000000 --- a/source/types-list/types-list.rst +++ /dev/null @@ -1,85 +0,0 @@ -Types list -========== - - -- DeblurStats - -- DistanceMatrix - -- EMPPairedEndSequences - -- EMPSingleEndSequences - -- ErrorCorrectionDetails - -- FeatureData[AlignedSequence] - -- FeatureData[Differential] - -- FeatureData[Importance] - -- FeatureData[PairedEndSequence] - -- FeatureData[Sequence] - -- FeatureData[Taxonomy] - -- FeatureTable[Balance] - -- FeatureTable[Composition] - -- FeatureTable[Frequency] - -- FeatureTable[PercentileNormalized] - -- FeatureTable[PresenceAbsence] - -- FeatureTable[RelativeFrequency] - -- Hierarchy - -- MultiplexedPairedEndBarcodeInSequence - -- MultiplexedSingleEndBarcodeInSequence - -- PCoAResults - -- Phylogeny[Rooted] - -- Phylogeny[Unrooted] - -- Placements - -- QualityFilterStats - -- RawSequences - -- SampleData[AlphaDiversity] - -- SampleData[BooleanSeries] - -- SampleData[ClassifierPredictions] - -- SampleData[DADA2Stats] - -- SampleData[FirstDifferences] - -- SampleData[JoinedSequencesWithQuality] - -- SampleData[PairedEndSequencesWithQuality] - -- SampleData[Probabilities] - -- SampleData[RegressorPredictions] - -- SampleData[SequencesWithQuality] - -- SampleData[Sequences] - -- SampleEstimator[Classifier] - -- SampleEstimator[Regressor] - -- TaxonomicClassifier - -- UchimeStats From 5103bc8b0ba5326f3c10018bdc4deaf23ad7c8d2 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 8 Nov 2019 07:43:30 -0700 Subject: [PATCH 08/10] SQUASH: Fix warning and strange transformers --- source/conf.py | 1 + .../types-formats-transformers/extension.py | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/source/conf.py b/source/conf.py index 2c1fbe09..8cc13a13 100644 --- a/source/conf.py +++ b/source/conf.py @@ -117,6 +117,7 @@ exclude_patterns = [ 'sphinx_extensions/plugin_directory/templates', 'sphinx_extensions/command_block/templates', + 'sphinx_extensions/types-formats-transformers/templates' ] # The reST default role (used for this markup: `text`) to use for all diff --git a/source/sphinx_extensions/types-formats-transformers/extension.py b/source/sphinx_extensions/types-formats-transformers/extension.py index b25fa666..33aa6493 100644 --- a/source/sphinx_extensions/types-formats-transformers/extension.py +++ b/source/sphinx_extensions/types-formats-transformers/extension.py @@ -53,22 +53,18 @@ def generate_rst(app): transformers_list = [] for from_type in pm.transformers: for to_type in pm.transformers[from_type]: - from_type = qiime2.core.util.get_view_name(from_type) - to_type = qiime2.core.util.get_view_name(to_type) - transformers_list.append((from_type, to_type)) + transformers_list.append((repr(from_type), repr(to_type))) # .upper() because Python sorts all capitalized elements above all # lowercase ones, and I figured we didn't want 'dict' sorting under # 'TaxonomicClassifierDirFmt' transformers_list.sort( - key=lambda element: (element[0].upper(), element[1].upper())) + key=lambda element: (element[0], element[1])) reverse_transformers_list = [] for to_type in pm._reverse_transformers: for from_type in pm.transformers[to_type]: - from_type = qiime2.core.util.get_view_name(to_type) - to_type = qiime2.core.util.get_view_name(from_type) - reverse_transformers_list.append((from_type, to_type)) + reverse_transformers_list.append((repr(from_type), repr(to_type))) # .upper() because Python sorts all capitalized elements above all # lowercase ones, and I figured we didn't want 'dict' sorting under From 3675e78b42ae1fd2488d4ce274197be702b8162f Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 8 Nov 2019 07:45:20 -0700 Subject: [PATCH 09/10] SQUASH: add .upper() back to transformer sorting to ensure proper order --- .../sphinx_extensions/types-formats-transformers/extension.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/sphinx_extensions/types-formats-transformers/extension.py b/source/sphinx_extensions/types-formats-transformers/extension.py index 33aa6493..23c59495 100644 --- a/source/sphinx_extensions/types-formats-transformers/extension.py +++ b/source/sphinx_extensions/types-formats-transformers/extension.py @@ -59,7 +59,7 @@ def generate_rst(app): # lowercase ones, and I figured we didn't want 'dict' sorting under # 'TaxonomicClassifierDirFmt' transformers_list.sort( - key=lambda element: (element[0], element[1])) + key=lambda element: (element[0].upper(), element[1].upper())) reverse_transformers_list = [] for to_type in pm._reverse_transformers: From 2871dbc4f9b777a751d6bcbec15a54dcebc54606 Mon Sep 17 00:00:00 2001 From: Anthony Date: Fri, 8 Nov 2019 07:48:14 -0700 Subject: [PATCH 10/10] SQUASH: Slight refactor --- .../types-formats-transformers/extension.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/sphinx_extensions/types-formats-transformers/extension.py b/source/sphinx_extensions/types-formats-transformers/extension.py index 23c59495..0d989456 100644 --- a/source/sphinx_extensions/types-formats-transformers/extension.py +++ b/source/sphinx_extensions/types-formats-transformers/extension.py @@ -33,6 +33,7 @@ def generate_rst(app): type_list = [] for type in pm.get_semantic_types(): type_list.append(repr(type)) + type_list.sort() importable_formats = [ repr(importable_format) for importable_format @@ -66,13 +67,9 @@ def generate_rst(app): for from_type in pm.transformers[to_type]: reverse_transformers_list.append((repr(from_type), repr(to_type))) - # .upper() because Python sorts all capitalized elements above all - # lowercase ones, and I figured we didn't want 'dict' sorting under - # 'TaxonomicClassifierDirFmt' reverse_transformers_list.sort( key=lambda element: (element[0].upper(), element[1].upper())) - type_list.sort() template = env.get_template('types-formats-transformers-list.rst') with open(index_path, 'w') as fh: rendered = template.render(