diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7eed0224b..e01b8f7f2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,7 @@ ===REMOVE=== Important! Please follow the guidelines for naming Pull Requests: - + **Note:** When squash-merging a PR into the main branch, @@ -12,5 +12,3 @@ GitHub will take the name of this single commit as squash-merge-commit message. In this case, you have to manually ensure that the squash-merge commit message is identical to the PR title. ===REMOVE=== - -resolves DEV- diff --git a/README.md b/README.md index ea6e505a1..141f2ceb7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,13 @@ -[![PyPI version](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) -[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint) +[![](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) +[![](https://img.shields.io/pypi/pyversions/dsp-tools.svg)](https://pypi.org/project/dsp-tools/) +[![](https://img.shields.io/badge/Python%20code%20style-black-000000.svg)](https://github.com/psf/black) +[![](https://img.shields.io/badge/Python%20linting-pylint-darkgreen)](https://github.com/pylint-dev/pylint) +[![](https://img.shields.io/badge/Python%20typing-mypy-darkgreen)](https://github.com/python/mypy) +[![](https://img.shields.io/badge/Markdown%20linting-markdownlint-darkgreen)]( + https://github.com/igorshubovych/markdownlint-cli) +[![](https://img.shields.io/badge/Link%20validation-markdown%20link%20validator-darkgreen)]( + https://www.npmjs.com/package/markdown-link-validator) + # DSP-TOOLS - DaSCH Service Platform Tools diff --git a/docs/file-formats/json-project/ontologies.md b/docs/file-formats/json-project/ontologies.md index a6680153a..dd2234055 100644 --- a/docs/file-formats/json-project/ontologies.md +++ b/docs/file-formats/json-project/ontologies.md @@ -251,7 +251,7 @@ These three are related as follows: | hasValue | BooleanValue | Checkbox | | hasColor | ColorValue | Colorpicker | | hasValue | DateValue | Date | -| hasValue | DecimalValue | Slider,
SimpleText | +| hasValue | DecimalValue | Spinbox,
SimpleText | | hasValue | GeonameValue | Geonames | | hasValue | IntValue | Spinbox,
SimpleText | | hasValue | ListValue | List | @@ -364,7 +364,7 @@ information. *gui_elements / gui_attributes*: -- `Slider`: Provides a slider to select a decimal value. +- `Spinbox`: Provides a spinbox to select a decimal value. - *gui_attributes*: - `max=decimal` (mandatory): maximal value - `min=decimal` (mandatory): minimal value @@ -896,12 +896,8 @@ See the [`isSequenceOf` property](#issequenceof-property) or the *gui_elements / gui_attributes*: -- `SimpleText`: A simple text entry box (one line only). - - *gui_attributes*: - - `maxlength=integer` (optional): The maximum number of characters accepted - - `size=integer` (optional): The size of the input field - - `Interval`: Two Sliders, one for each decimal - - *gui_attributes*: No attributes +- `Interval`: Two spinboxes, one for each decimal + - *gui_attributes*: No attributes Example: diff --git a/docs/index.md b/docs/index.md index 5f959c416..6f978ab8a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,12 @@ -[![PyPI version](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) -[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint) +[![](https://badge.fury.io/py/dsp-tools.svg)](https://badge.fury.io/py/dsp-tools) +[![](https://img.shields.io/pypi/pyversions/dsp-tools.svg)](https://pypi.org/project/dsp-tools/) +[![](https://img.shields.io/badge/Python%20code%20style-black-000000.svg)](https://github.com/psf/black) +[![](https://img.shields.io/badge/Python%20linting-pylint-darkgreen)](https://github.com/pylint-dev/pylint) +[![](https://img.shields.io/badge/Python%20typing-mypy-darkgreen)](https://github.com/python/mypy) +[![](https://img.shields.io/badge/Markdown%20linting-markdownlint-darkgreen)]( + https://github.com/igorshubovych/markdownlint-cli) +[![](https://img.shields.io/badge/Link%20validation-markdown%20link%20validator-darkgreen)]( + https://www.npmjs.com/package/markdown-link-validator) # DSP-TOOLS documentation diff --git a/src/dsp_tools/resources/schema/project.json b/src/dsp_tools/resources/schema/project.json index 1fe26e879..3acd3caf0 100644 --- a/src/dsp_tools/resources/schema/project.json +++ b/src/dsp_tools/resources/schema/project.json @@ -112,7 +112,6 @@ "Richtext", "Searchbox", "SimpleText", - "Slider", "Spinbox", "Textarea", "TimeStamp" @@ -589,7 +588,7 @@ }, "gui_element": { "enum": [ - "Slider", + "Spinbox", "SimpleText" ] } @@ -755,10 +754,7 @@ } }, "gui_element": { - "enum": [ - "Interval", - "SimpleText" - ] + "const": "Interval" } } } @@ -897,34 +893,6 @@ } } }, - { - "if": { - "properties": { - "gui_element": { - "const": "Slider" - } - } - }, - "then": { - "properties": { - "gui_attributes": { - "type": "object", - "properties": { - "max": { - "type": "number" - }, - "min": { - "type": "number" - } - }, - "additionalProperties": false - } - }, - "required": [ - "gui_attributes" - ] - } - }, { "if": { "properties": { diff --git a/src/dsp_tools/resources/schema/properties-only.json b/src/dsp_tools/resources/schema/properties-only.json index df1911831..32ba55bad 100644 --- a/src/dsp_tools/resources/schema/properties-only.json +++ b/src/dsp_tools/resources/schema/properties-only.json @@ -88,7 +88,6 @@ "Richtext", "Searchbox", "SimpleText", - "Slider", "Spinbox", "Textarea", "TimeStamp" @@ -419,7 +418,7 @@ }, "gui_element": { "enum": [ - "Slider", + "Spinbox", "SimpleText" ] } @@ -585,10 +584,7 @@ } }, "gui_element": { - "enum": [ - "Interval", - "SimpleText" - ] + "const": "Interval" } } } @@ -727,34 +723,6 @@ } } }, - { - "if": { - "properties": { - "gui_element": { - "const": "Slider" - } - } - }, - "then": { - "properties": { - "gui_attributes": { - "type": "object", - "properties": { - "max": { - "type": "number" - }, - "min": { - "type": "number" - } - }, - "additionalProperties": false - } - }, - "required": [ - "gui_attributes" - ] - } - }, { "if": { "properties": { diff --git a/test/unittests/test_excel_to_json_properties.py b/test/unittests/test_excel_to_json_properties.py index adf0520dc..03bdd2053 100644 --- a/test/unittests/test_excel_to_json_properties.py +++ b/test/unittests/test_excel_to_json_properties.py @@ -248,7 +248,7 @@ def test_excel2properties(self) -> None: "Date", "SimpleText", "Colorpicker", - "Slider", + "Spinbox", "TimeStamp", "Interval", "Checkbox", @@ -334,11 +334,11 @@ def test_validate_properties(self) -> None: "testdata/invalid-testdata/excel2json/properties-invalid-gui_element.xlsx", "did not pass validation. The problematic property is 'hasInterval' in Excel row 4. " r"The problem is that the column 'gui_element' has an invalid value: " - r"'Geonames' is not one of \['Interval', 'SimpleText'\]", + r"'Interval' was expected", ), ( "testdata/invalid-testdata/excel2json/properties-invalid-gui_attribute.xlsx", - "did not pass validation. The problematic property is 'hasInterval' in Excel row 4. " + "did not pass validation. The problematic property is 'hasInteger' in Excel row 4. " r"The problem is that the column 'gui_attributes' has an invalid value: " r"Additional properties are not allowed \('rows' was unexpected\)", ), diff --git a/testdata/excel2json/excel2json-expected-output.json b/testdata/excel2json/excel2json-expected-output.json index 8d0d7524a..6032eca6d 100644 --- a/testdata/excel2json/excel2json-expected-output.json +++ b/testdata/excel2json/excel2json-expected-output.json @@ -376,7 +376,7 @@ "de": "Dezimalzahl", "fr": "Chiffre décimale" }, - "gui_element": "Slider", + "gui_element": "Spinbox", "gui_attributes": { "min": 0.0, "max": 100.0 diff --git a/testdata/excel2json/excel2json_files/test-name (test_label)/properties.xlsx b/testdata/excel2json/excel2json_files/test-name (test_label)/properties.xlsx index bdd57544c..28a18ebee 100644 Binary files a/testdata/excel2json/excel2json_files/test-name (test_label)/properties.xlsx and b/testdata/excel2json/excel2json_files/test-name (test_label)/properties.xlsx differ diff --git a/testdata/invalid-testdata/excel2json/properties-invalid-gui_attribute.xlsx b/testdata/invalid-testdata/excel2json/properties-invalid-gui_attribute.xlsx index 25531965b..881e02d41 100644 Binary files a/testdata/invalid-testdata/excel2json/properties-invalid-gui_attribute.xlsx and b/testdata/invalid-testdata/excel2json/properties-invalid-gui_attribute.xlsx differ diff --git a/testdata/json-project/test-project-systematic.json b/testdata/json-project/test-project-systematic.json index ae19c3c10..5415258ad 100644 --- a/testdata/json-project/test-project-systematic.json +++ b/testdata/json-project/test-project-systematic.json @@ -352,10 +352,10 @@ "labels": { "en": "Decimal number" }, - "gui_element": "SimpleText", + "gui_element": "Spinbox", "gui_attributes": { - "maxlength": 255, - "size": 80 + "max": 100.0, + "min": 0.0 } }, {