Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Missing constant annotation when the same value is sometimes converted to string #34

Open
Aclrian opened this issue Jul 1, 2022 · 1 comment
Labels
bug 🪲 Something isn't working @constant Related to the @constant annotation @optional Related to the @optional annotation wrong annotation An annotation was generated automatically but is incorrect

Comments

@Aclrian
Copy link
Contributor

Aclrian commented Jul 1, 2022

URL Hash

#/sklearn/sklearn.preprocessing._data/scale/with_mean

Actual Annotation Type

@optional

Actual Annotation Inputs

{
    "target": "sklearn/sklearn.preprocessing._data/scale/with_mean",
    "authors": [
        "$autogen$"
    ],
    "defaultType": "boolean",
    "defaultValue": true
}

Expected Annotation Type

@constant

Expected Annotation Inputs

with value True (boolean)

Minimal API Data (optional)

Minimal API Data for `sklearn/sklearn.preprocessing._data/scale/with_mean`
{
    "schemaVersion": 1,
    "distribution": "scikit-learn",
    "package": "sklearn",
    "version": "1.1.1",
    "modules": [
        {
            "id": "sklearn/sklearn.preprocessing",
            "name": "sklearn.preprocessing",
            "imports": [],
            "from_imports": [
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "add_dummy_feature",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "binarize",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "Binarizer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "KernelCenterer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "maxabs_scale",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "MaxAbsScaler",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "minmax_scale",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "MinMaxScaler",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "normalize",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "Normalizer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "power_transform",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "PowerTransformer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "quantile_transform",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "QuantileTransformer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "robust_scale",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "RobustScaler",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "scale",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._data",
                    "declaration": "StandardScaler",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._discretization",
                    "declaration": "KBinsDiscretizer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._encoders",
                    "declaration": "OneHotEncoder",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._encoders",
                    "declaration": "OrdinalEncoder",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._function_transformer",
                    "declaration": "FunctionTransformer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._label",
                    "declaration": "label_binarize",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._label",
                    "declaration": "LabelBinarizer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._label",
                    "declaration": "LabelEncoder",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._label",
                    "declaration": "MultiLabelBinarizer",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._polynomial",
                    "declaration": "PolynomialFeatures",
                    "alias": null
                },
                {
                    "module": "sklearn.preprocessing._polynomial",
                    "declaration": "SplineTransformer",
                    "alias": null
                }
            ],
            "classes": [],
            "functions": [
                "sklearn/sklearn.preprocessing._data/scale"
            ]
        }
    ],
    "classes": [],
    "functions": [
        {
            "id": "sklearn/sklearn.preprocessing._data/scale",
            "name": "scale",
            "qname": "sklearn.preprocessing._data.scale",
            "decorators": [],
            "parameters": [
                {
                    "id": "sklearn/sklearn.preprocessing._data/scale/with_mean",
                    "name": "with_mean",
                    "qname": "sklearn.preprocessing._data.scale.with_mean",
                    "default_value": "True",
                    "assigned_by": "NAME_ONLY",
                    "is_public": true,
                    "docstring": {
                        "type": "bool, default=True",
                        "description": "If True, center the data before scaling."
                    },
                    "type": {}
                }
            ],
            "results": [],
            "is_public": true,
            "reexported_by": [
                "sklearn/sklearn.preprocessing"
            ],
            "description": "Standardize a dataset along any axis.\n\nCenter to the mean and component wise scale to unit variance.\n\nRead more in the :ref:`User Guide <preprocessing_scaler>`.",
            "docstring": "Standardize a dataset along any axis.\n\n    Center to the mean and component wise scale to unit variance.\n\n    Read more in the :ref:`User Guide <preprocessing_scaler>`.\n\n    Parameters\n    ----------\n    X : {array-like, sparse matrix} of shape (n_samples, n_features)\n        The data to center and scale.\n\n    axis : int, default=0\n        axis used to compute the means and standard deviations along. If 0,\n        independently standardize each feature, otherwise (if 1) standardize\n        each sample.\n\n    with_mean : bool, default=True\n        If True, center the data before scaling.\n\n    with_std : bool, default=True\n        If True, scale the data to unit variance (or equivalently,\n        unit standard deviation).\n\n    copy : bool, default=True\n        set to False to perform inplace row normalization and avoid a\n        copy (if the input is already a numpy array or a scipy.sparse\n        CSC matrix and if axis is 1).\n\n    Returns\n    -------\n    X_tr : {ndarray, sparse matrix} of shape (n_samples, n_features)\n        The transformed data.\n\n    Notes\n    -----\n    This implementation will refuse to center scipy.sparse matrices\n    since it would make them non-sparse and would potentially crash the\n    program with memory exhaustion problems.\n\n    Instead the caller is expected to either set explicitly\n    `with_mean=False` (in that case, only variance scaling will be\n    performed on the features of the CSC matrix) or to call `X.toarray()`\n    if he/she expects the materialized dense array to fit in memory.\n\n    To avoid memory copy the caller should pass a CSC matrix.\n\n    NaNs are treated as missing values: disregarded to compute the statistics,\n    and maintained during the data transformation.\n\n    We use a biased estimator for the standard deviation, equivalent to\n    `numpy.std(x, ddof=0)`. Note that the choice of `ddof` is unlikely to\n    affect model performance.\n\n    For a comparison of the different scalers, transformers, and normalizers,\n    see :ref:`examples/preprocessing/plot_all_scaling.py\n    <sphx_glr_auto_examples_preprocessing_plot_all_scaling.py>`.\n\n    .. warning:: Risk of data leak\n\n        Do not use :func:`~sklearn.preprocessing.scale` unless you know\n        what you are doing. A common mistake is to apply it to the entire data\n        *before* splitting into training and test sets. This will bias the\n        model evaluation because information would have leaked from the test\n        set to the training set.\n        In general, we recommend using\n        :class:`~sklearn.preprocessing.StandardScaler` within a\n        :ref:`Pipeline <pipeline>` in order to prevent most risks of data\n        leaking: `pipe = make_pipeline(StandardScaler(), LogisticRegression())`.\n\n    See Also\n    --------\n    StandardScaler : Performs scaling to unit variance using the Transformer\n        API (e.g. as part of a preprocessing\n        :class:`~sklearn.pipeline.Pipeline`).\n\n    "
        }
    ]
}

Minimal Usage Store (optional)

Minimal Usage Store for `sklearn/sklearn.preprocessing._data/scale/with_mean`
{
    "schemaVersion": 1,
    "module_counts": {
        "sklearn/sklearn.preprocessing": 50891
    },
    "class_counts": {},
    "function_counts": {
        "sklearn/sklearn.preprocessing._data/scale": 314
    },
    "parameter_counts": {
        "sklearn/sklearn.preprocessing._data/scale/with_mean": 10
    },
    "value_counts": {
        "sklearn/sklearn.preprocessing._data/scale/with_mean": {
            "True": 311,
            "'True'": 3
        }
    }
}

Suggested Solution (optional)

No response

Additional Context (optional)

True: 311
'True': 3

@Aclrian Aclrian added bug 🪲 Something isn't working wrong annotation An annotation was generated automatically but is incorrect @constant Related to the @constant annotation @optional Related to the @optional annotation labels Jul 1, 2022
@lars-reimann
Copy link
Member

More generally: Invalid values should be filtered out. In this case it works because a non-empty string is considered "truthy". Even passing 'False' would have the same effect as passing True.

@lars-reimann lars-reimann transferred this issue from Safe-DS/API-Editor Mar 19, 2023
lars-reimann pushed a commit that referenced this issue Jun 1, 2024
Bumps [mkdocs-glightbox](https://github.com/Blueswen/mkdocs-glightbox)
from 0.3.7 to 0.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Blueswen/mkdocs-glightbox/releases">mkdocs-glightbox's
releases</a>.</em></p>
<blockquote>
<h2>mkdocs-glightbox-0.4.0</h2>
<ul>
<li>Supported manual mode (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/29">#29</a>)</li>
<li>Allow calling lightbox methods from other places (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/34">#34</a>)</li>
<li>Added id to appended script tag (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/38">#38</a>)</li>
<li>Access theme attribute directly (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/40">#40</a>)</li>
<li>Better JavaScript Error Handling (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/36">#36</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/blueswen/mkdocs-glightbox/blob/main/CHANGELOG">mkdocs-glightbox's
changelog</a>.</em></p>
<blockquote>
<p>mkdocs-glightbox-0.4.0 (2023-05-06)</p>
<pre><code>* Supported manual mode
([#29](blueswen/mkdocs-glightbox#29))
* Allow calling lightbox methods from other places
([#34](blueswen/mkdocs-glightbox#34))
* Added id to appended script tag
([#38](blueswen/mkdocs-glightbox#38))
* Access theme attribute directly
([#40](blueswen/mkdocs-glightbox#40))
* Better JavaScript Error Handling
([#36](blueswen/mkdocs-glightbox#36))
</code></pre>
<p>mkdocs-glightbox-0.3.7 (2023-01-24)</p>
<pre><code>* Supported custom background and shadow
([#27](blueswen/mkdocs-glightbox#27))
</code></pre>
<p>mkdocs-glightbox-0.3.6 (2023-12-30)</p>
<pre><code>* Modified width default to auto prevent zooming large image
bug ([#21](blueswen/mkdocs-glightbox#21))
* Supported only enable glightbox with on-glb class in given page
([#28](blueswen/mkdocs-glightbox#28))
</code></pre>
<p>mkdocs-glightbox-0.3.5 (2023-11-18)</p>
<pre><code>* Supported compatibility with the privacy plugin of Material
for MkDocs insiders
([#25](blueswen/mkdocs-glightbox#25))
</code></pre>
<p>mkdocs-glightbox-0.3.4 (2023-04-25)</p>
<pre><code>* Fixed regex bug: quote issue and empty alt issue
([#14](blueswen/mkdocs-glightbox#14)
[#19](blueswen/mkdocs-glightbox#19))
</code></pre>
<p>mkdocs-glightbox-0.3.3 (2023-04-20)</p>
<pre><code>* Refactored processing logic with regex
([#14](blueswen/mkdocs-glightbox#14))
</code></pre>
<p>mkdocs-glightbox-0.3.2 (2023-03-19)</p>
<pre><code>* Supported image without extension
([#13](blueswen/mkdocs-glightbox#13))
</code></pre>
<p>mkdocs-glightbox-0.3.1 (2022-11-22)</p>
<pre><code>* Supported lightbox slide effect customization
([#8](blueswen/mkdocs-glightbox#8))
* Supported synchronized lightbox caption dark mode with Material for
MkDocs ([#7](blueswen/mkdocs-glightbox#7))
* Supported glightbox built-in gallery feature
([#11](blueswen/mkdocs-glightbox#11))
* Supported skip image in the anchor tag
</code></pre>
<p>mkdocs-glightbox-0.3.0 (2022-09-29)</p>
<pre><code>* Fixed width and height setting in config not working bug
* Supported specific skip class
([#5](blueswen/mkdocs-glightbox#5))
* Supported glightbox built-in caption with title and description
([#4](blueswen/mkdocs-glightbox#4))
* Fixed page jitter when lightbox closing issue using Material for
MkDocs
* Add white background for lightbox images to prevent the displaying
issue of the transparent image on black background
</code></pre>
<p>mkdocs-glightbox-0.2.1 (2022-08-10)</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/7f68f19556c8d91eb45bed2f5e3b93f9d0b4e591"><code>7f68f19</code></a>
v0.4.0</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/1409b0de89bd0aa930bbee0c2aa801c8b3391137"><code>1409b0d</code></a>
Add manual mode</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/e5ce7c9214f2de3647cbb1c9a1ec67bd82b387f9"><code>e5ce7c9</code></a>
Add search plugin note</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/d7747e7e1e58e8fe5868f38292bbb6a65f5ac902"><code>d7747e7</code></a>
Merge pull request <a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/29">#29</a>
from michalfapso/main</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/6895d4eb60ef383530f8a807bec19404342a74c3"><code>6895d4e</code></a>
Add test case</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/dc38a6c042da9dcf949a594940f312cfbf5cc1ae"><code>dc38a6c</code></a>
try catch prevent Uncaught TypeError (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/36">#36</a>)</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/7d2c0ab4b214759f7ab22ab9e775c609718ad061"><code>7d2c0ab</code></a>
access theme attribute directly (<a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/40">#40</a>)</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/b0b63f8fa2bfbd14812c95b466af180e34db2cc4"><code>b0b63f8</code></a>
Merge pull request <a
href="https://redirect.github.com/Blueswen/mkdocs-glightbox/issues/34">#34</a>
from AndBondStyle/main</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/8e652652429851d18a0c920ca1ddcbf12ab71fdf"><code>8e65265</code></a>
update validation condition</li>
<li><a
href="https://github.com/blueswen/mkdocs-glightbox/commit/4963fdb93c4f483827bcab10c5289452068e1fb5"><code>4963fdb</code></a>
Merge branch 'main' into main</li>
<li>Additional commits viewable in <a
href="https://github.com/Blueswen/mkdocs-glightbox/compare/v0.3.7...v0.4.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mkdocs-glightbox&package-manager=pip&previous-version=0.3.7&new-version=0.4.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🪲 Something isn't working @constant Related to the @constant annotation @optional Related to the @optional annotation wrong annotation An annotation was generated automatically but is incorrect
Projects
Status: Backlog
Development

No branches or pull requests

2 participants