[med-svn] [Git][med-team/q2-metadata][upstream] New upstream version 2022.11.1

Andreas Tille (@tille) gitlab at salsa.debian.org
Sat Jan 14 15:43:50 GMT 2023



Andreas Tille pushed to branch upstream at Debian Med / q2-metadata


Commits:
cb332957 by Andreas Tille at 2023-01-13T13:47:31+01:00
New upstream version 2022.11.1
- - - - -


6 changed files:

- + .github/workflows/add-to-project-ci.yml
- ci/recipe/meta.yaml
- + q2_metadata/_examples.py
- q2_metadata/_version.py
- q2_metadata/plugin_setup.py
- q2_metadata/tests/test_tabulate.py


Changes:

=====================================
.github/workflows/add-to-project-ci.yml
=====================================
@@ -0,0 +1,21 @@
+name: Add new issues and PRs to triage project board
+
+on:
+  issues:
+    types:
+      - opened
+  pull_request_target:
+    types:
+      - opened
+
+jobs:
+  add-to-project:
+    name: Add issue to project
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/add-to-project at v0.3.0
+        with:
+          project-url: https://github.com/orgs/qiime2/projects/36
+          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
+          labeled: skip-triage
+          label-operator: NOT


=====================================
ci/recipe/meta.yaml
=====================================
@@ -25,12 +25,14 @@ requirements:
     - qiime2 {{ qiime2_epoch }}.*
     - q2templates {{ qiime2_epoch }}.*
     - q2-types {{ qiime2_epoch }}.*
+    - q2-quality-filter {{ qiime2_epoch }}.*
 
 test:
   requires:
     - qiime2 >={{ qiime2 }}
     - q2templates >={{ q2templates }}
     - q2-types >={{ q2_types }}
+    - q2-quality-filter >={{ q2_quality_filter }}
     - pytest
 
   imports:


=====================================
q2_metadata/_examples.py
=====================================
@@ -0,0 +1,61 @@
+# ----------------------------------------------------------------------------
+# Copyright (c) 2016-2022, 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 qiime2
+
+
+stats_url = ('https://data.qiime2.org/usage-examples/'
+             'moving-pictures/demux-filter-stats.qza')
+faith_pd_url = ('https://data.qiime2.org/usage-examples/moving-pictures/'
+                'core-metrics-results/faith_pd_vector.qza')
+
+metadata_url = (f'https://data.qiime2.org/{qiime2.__release__}/tutorials/'
+                'moving-pictures/sample_metadata.tsv')
+
+
+def tabulate_example(use):
+    stats = use.init_artifact_from_url('demux_stats', stats_url)
+    stats_md = use.view_as_metadata('stats_as_md', stats)
+
+    viz, = use.action(
+        use.UsageAction('metadata', 'tabulate'),
+        use.UsageInputs(
+            input=stats_md,
+        ),
+        use.UsageOutputNames(
+            visualization='demux_stats_viz',
+        )
+    )
+
+    viz.assert_output_type('Visualization')
+
+
+def tabulate_multiple_files_example(use):
+    md = use.init_metadata_from_url('sample-metadata', metadata_url)
+    faith_pd = use.init_artifact_from_url('faith_pd_vector', faith_pd_url)
+    faith_pd_as_md = use.view_as_metadata('faith_pd_as_metadata', faith_pd)
+
+    merged = use.merge_metadata('merged', md, faith_pd_as_md)
+
+    use.comment(
+        "Multiple metadata files or artifacts viewed as metadata can be merged"
+        " to make one tabular visualization. "
+        "This one displays only 25 metadata rows per page."
+    )
+    viz, = use.action(
+        use.UsageAction('metadata', 'tabulate'),
+        use.UsageInputs(
+            input=merged,
+            page_size=25,
+        ),
+        use.UsageOutputNames(
+            visualization='demux_stats_viz',
+        )
+    )
+
+    viz.assert_output_type('Visualization')


=====================================
q2_metadata/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (tag: 2022.8.0)"
-    git_full = "671cbd512c4b9fe498e631ad250f80eb383331cc"
-    git_date = "2022-08-23 16:29:07 +0000"
+    git_refnames = " (HEAD -> master, tag: 2022.11.1)"
+    git_full = "3fb78377c3aa05380d57e101e6146fb4099ea437"
+    git_date = "2022-12-21 22:06:24 +0000"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
q2_metadata/plugin_setup.py
=====================================
@@ -6,23 +6,20 @@
 # The full license is in the file LICENSE, distributed with this software.
 # ----------------------------------------------------------------------------
 
-import qiime2.plugin
-from qiime2.plugin import (MetadataColumn, Numeric, SemanticType, Categorical,
-                           Int, Str, ValidationError)
-import qiime2.plugin.model as model
-
-import q2_metadata
-
-from q2_metadata import tabulate, distance_matrix, shuffle_groups
+import pandas as pd
 from q2_types.distance_matrix import DistanceMatrix
 from q2_types.sample_data import SampleData
+import qiime2.plugin
+from qiime2.plugin import (
+    Int, Categorical, MetadataColumn, model, Numeric, Plugin, SemanticType,
+    Str, ValidationError,
+)
 
-import pandas as pd
-
+from . import _examples, tabulate, distance_matrix, shuffle_groups, __version__
 
-plugin = qiime2.plugin.Plugin(
+plugin = Plugin(
     name='metadata',
-    version=q2_metadata.__version__,
+    version=__version__,
     website='https://github.com/qiime2/q2-metadata',
     package='q2_metadata',
     user_support_text=None,
@@ -63,6 +60,10 @@ plugin.visualizers.register_function(
     description='Generate a tabular view of Metadata. The output '
                 'visualization supports interactive filtering, sorting, and '
                 'exporting to common file formats.',
+    examples={
+        'basic_tabulate_usage': _examples.tabulate_example,
+        'tabulate_multiple_files': _examples.tabulate_multiple_files_example
+    },
 )
 
 ArtificialGrouping = \


=====================================
q2_metadata/tests/test_tabulate.py
=====================================
@@ -12,6 +12,7 @@ import tempfile
 
 import pandas as pd
 import qiime2
+from qiime2.plugin.testing import TestPluginBase
 
 from q2_metadata import tabulate
 
@@ -100,5 +101,12 @@ class TabulateTests(TestCase):
                 tabulate(output_dir, md, -1)
 
 
+class TestUsageExamples(TestPluginBase):
+    package = 'q2_metadata.tests'
+
+    def test_examples(self):
+        self.execute_examples()
+
+
 if __name__ == "__main__":
     main()



View it on GitLab: https://salsa.debian.org/med-team/q2-metadata/-/commit/cb332957ab4cfaea26b0fc61d442b4c1ece12ac4

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2-metadata/-/commit/cb332957ab4cfaea26b0fc61d442b4c1ece12ac4
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230114/dfdbb7ed/attachment-0001.htm>


More information about the debian-med-commit mailing list