aeon-toolkit / aeon

A toolkit for machine learning from time series
https://aeon-toolkit.org/
BSD 3-Clause "New" or "Revised" License
1.02k stars 128 forks source link

[BUG] Fix bug_report.yml template show_versions #2321

Closed SebastianSchmidl closed 2 weeks ago

SebastianSchmidl commented 2 weeks ago

The show_versions()-utility is in the package aeon or aeon.utils._maint and cannot be imported from aeon.utils. This fixes the template to import from aeon.

aeon-actions-bot[bot] commented 2 weeks ago

Thank you for contributing to aeon

I did not find any labels to add that did not already exist. If the content of your PR changes, make sure to update the labels accordingly.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

PR CI actions

These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

TonyBagnall commented 2 weeks ago

show_versions returns a string, so it should be

from aeon.utils import show_versions
print(show_versions())

I think there is some legacy bug here, there is an argument to return string, default to false, but it is not used


def show_versions(as_str: bool = False) -> Union[str, None]:
    """Print useful debugging information.

    Parameters
    ----------
    as_str : bool, default=False
        If True, return the output as a string instead of printing.

    Returns
    -------
    str or None
        The output string if `as_str` is True, otherwise None.

    Examples
    --------
    >>> from aeon.utils import show_versions
    >>> vers = show_versions(as_str=True)
    """
    sys_info = {
        "python": sys.version.replace("\n", " "),
        "executable": sys.executable,
        "machine": platform.platform(),
    }
    str = "\nSystem:"
    for k, stat in sys_info.items():
        str = f"{str}\n{k:>10}: {stat}"

    deps_info = {"aeon": __version__}
    for modname in deps:
        try:
            deps_info[modname] = version(modname)
        except PackageNotFoundError:
            deps_info[modname] = None
    str = f"{str}\nPython dependencies:"
    for k, stat in deps_info.items():
        str = f"{str}\n{k:>13}: {stat}"  # noqa: T001, T201
    return str
SebastianSchmidl commented 2 weeks ago

Ah, @MatthewMiddlehurst changed that in #2167. For all published versions (thus all pip installs of aeon), however, the issue template instructions do not work. I doubt that our users use the current main.

SebastianSchmidl commented 2 weeks ago

Should we add an issue to change it back once v1.0.0 (or the next version) is out?