diff --git a/.github/workflows/tests_local.yml b/.github/workflows/tests_local.yml index ea0690a8..ca2c2fd1 100644 --- a/.github/workflows/tests_local.yml +++ b/.github/workflows/tests_local.yml @@ -2,6 +2,8 @@ name: tests_local on: + schedule: + - cron: '0 1 * * *' pull_request: push: branches: @@ -37,19 +39,50 @@ jobs: uses: ./.github/actions/create_python_environment - name: Get Python package manager run: echo "PYTHON_PACKAGE_MANAGER=${{steps.environment.outputs.ppm}}" >> $GITHUB_ENV - - name: Codechecks + - name: Code checks run: | $PYTHON_PACKAGE_MANAGER activate queens - isort --check-only queens tests > track_isort.txt 2>&1 - black --check queens tests > track_black.txt 2>&1 - pylint --rcfile=.pylintrc_ci queens tests | tee track_pylint.txt 2>&1 - pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0 - python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json - pydocstyle --match-dir='^(?!.*test).*$' queens > track_pydocstyle.txt 2>&1 + + echo "::group::Run isort..." + isort --check-only queens tests + echo "::endgroup::" + + echo "::group::Run black..." + black --check queens tests + echo "::endgroup::" + + echo "::group::Run pylint..." + pylint --rcfile=.pylintrc_ci queens tests + echo "::endgroup::" + + echo "::group::Run ruff..." + ruff check + echo "::endgroup::" + + # echo "::group::Create code quality report..." + # pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0 + # python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json + # echo "::endgroup::" + + echo "::group::Check compatibility with licenses of dependencies..." + liccheck -r requirements.txt + echo "::endgroup::" + + echo "::group::Create an rc file for the license header check..." + python .gitlab/pipeline_utils/create_licenserc.py --template_file ".gitlab/pipeline_utils/.licenserc_template.yaml" --text_file "license_header.tmpl" --output_file ".licenserc.yaml" --placeholder "license_header" + echo "::endgroup::" + - name: Check License headers + uses: apache/skywalking-eyes/header@v0.4.0 - name: Run pytest run: | $PYTHON_PACKAGE_MANAGER activate queens pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes -o junit_logging=all --junitxml=test_junit.xml + - name: Upload coverage report + uses: actions/upload-pages-artifact@v3 + with: + name: html-coverage-report + path: html_coverage_report/ + retention-days: 7 - name: Publish junit pytest report uses: mikepenz/action-junit-report@v5 if: success() || failure() # always run even if the previous step fails diff --git a/.gitlab/pipeline_utils/update_changelog.py b/.gitlab/pipeline_utils/update_changelog.py index 69415b50..8a217cd0 100644 --- a/.gitlab/pipeline_utils/update_changelog.py +++ b/.gitlab/pipeline_utils/update_changelog.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -17,7 +17,7 @@ import sys from pathlib import Path -import gitlab +import gitlab # pylint: disable=import-error CHANGE_KEY = "change:" @@ -28,6 +28,7 @@ def create_section(name, link, date, message, header_symbol, newline=True): Args: name (str): Name of the tag link (str): Link of the tag + date (obj): Date of the tag message (str): Tag message header_symbol (str): Symbol of the section newline (bool): Add newline after the section name diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 555d4737..74781fdb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,12 @@ default_stages: [pre-commit, pre-merge-commit, pre-push, manual] repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.2 # Ruff version + hooks: + # Run the linter. + # Needs to placed before black, isort, and other formatters + - id: ruff + args: [ --fix ] - repo: local hooks: - id: trailing-whitespace @@ -24,12 +31,6 @@ repos: language: python types: ["python"] pass_filenames: true - - id: pydocstyle - name: pydocstyle - entry: pydocstyle - language: python - types: ["python"] - additional_dependencies: ["toml"] - id: docformatter name: docformatter entry: docformatter diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 067e36cc..cd9980d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,7 +52,7 @@ will lead to failing CI pipelines and will therefore not be merged. The code checks are conducted with [Pylint](https://pylint.org/), [isort](https://github.com/PyCQA/isort), and [Black](https://github.com/psf/black). Compliance with [Google style docstrings](https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings) -is checked with [pydocstyle](https://github.com/PyCQA/pydocstyle). +is checked with [ruff](https://github.com/astral-sh/ruff). Complete and meaningful docstrings are required as they are used to generate the [documentation](#reading-and-writing-documentation). diff --git a/dev-requirements.in b/dev-requirements.in index eadf113a..3127e5dc 100644 --- a/dev-requirements.in +++ b/dev-requirements.in @@ -17,6 +17,6 @@ pydata-sphinx-theme pandoc pip-tools commitizen>=3.12.0 -pydocstyle>=6.3.0 docformatter>=1.5.1 yamllint>=1.19.0 +ruff diff --git a/dev-requirements.txt b/dev-requirements.txt index 274d1525..e46df750 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -165,8 +165,6 @@ prompt-toolkit==3.0.36 # via questionary pydata-sphinx-theme==0.16.0 # via -r dev-requirements.in -pydocstyle==6.3.0 - # via -r dev-requirements.in pygments==2.18.0 # via # -c requirements.txt @@ -214,6 +212,8 @@ ruamel-yaml==0.18.6 # via pre-commit-hooks ruamel-yaml-clib==0.2.12 # via ruamel-yaml +ruff==0.9.2 + # via -r dev-requirements.in semantic-version==2.10.0 # via liccheck six==1.16.0 @@ -222,9 +222,7 @@ six==1.16.0 # bleach # python-dateutil snowballstemmer==2.2.0 - # via - # pydocstyle - # sphinx + # via sphinx soupsieve==2.6 # via beautifulsoup4 sphinx==8.1.3 diff --git a/lic_strategy.ini b/lic_strategy.ini deleted file mode 100644 index 0b3407a7..00000000 --- a/lic_strategy.ini +++ /dev/null @@ -1,48 +0,0 @@ -# Authorized and unauthorized licenses in LOWER CASE -[Licenses] -authorized_licenses: - bsd - new bsd - bsd license - new bsd license - 3-clause bsd - BSD 3-Clause - BSD-3-Clause - simplified bsd - apache - apache 2.0 - Apache-2.0 - apache software license - apache license, version 2.0 - apache license version 2.0 - apache license 2.0 - apache software - CMU License (MIT-CMU) - gnu lgpl - GNU Library or Lesser General Public License (LGPL) - lgpl - isc - isc license - isc license (iscl) - mit - mit license - python software foundation - python software foundation license - mozilla public license 2.0 - mozilla public license 2.0 (mpl 2.0) - historical permission notice and disclaimer (hpnd) - University of Illinois/NCSA Open Source - zlib/libpng - -unauthorized_licenses: - gpl v3 - gpl - GNU general public license (gpl) -[Authorized Packages] - # filelock has public domain license without restrictions - # see https://github.com/tox-dev/py-filelock - filelock: >=3 - # cons is under LGPL - cons: >=0.4.5 - # namex is under Apache 2.0 see https://github.com/fchollet/namex?tab=License-1-ov-file - namex: ==0.0.8 diff --git a/pyproject.toml b/pyproject.toml index 9aad0a22..1868a8c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,10 +58,12 @@ force_grid_wrap = 0 multi_line_output = 3 include_trailing_comma = true -[tool.pydocstyle] +[tool.ruff.lint] +select = ["D"] # pydocstyle rules +ignore = ["D104"] # Missing docstring in public package + +[tool.ruff.lint.pydocstyle] convention = "google" -match-dir = '(?!tests).*' -match = '(?!__init__).*\.py' [tool.pytest.ini_options] addopts = '-m "not benchmark and not lnm_cluster and not imcs_cluster" --doctest-modules --doctest-continue-on-failure --doctest-ignore-import-errors' @@ -92,3 +94,57 @@ show_missing = false [tool.coverage.html] directory = "html_coverage_report" + +[tool.liccheck] +authorized_licenses = [ + "apache", + "apache 2.0", + "Apache-2.0", + "apache software license", + "apache license, version 2.0", + "apache license version 2.0", + "apache license 2.0", + "apache software", + "bsd", + "new bsd", + "bsd license", + "new bsd license", + "3-clause bsd", + "BSD 3-Clause", + "BSD-3-Clause", + "simplified bsd", + "CMU License (MIT-CMU)", + "gnu lgpl", + "GNU Library or Lesser General Public License (LGPL)", + "lgpl", + "historical permission notice and disclaimer (hpnd)", + "isc", + "isc license", + "isc license (iscl)", + "mit", + "mit license", + "mozilla public license 2.0", + "mozilla public license 2.0 (mpl 2.0)", + "python software foundation", + "python software foundation license", + "University of Illinois/NCSA Open Source", + "zlib/libpng", +] +unauthorized_licenses = [ + "gpl v3", + "gpl v2", + "gpl", + "GNU general public license (gpl)", + "IBM Public License", + "RPL", + "Reciprocal Public License", + "Sleepycat License", +] +[tool.liccheck.authorized_packages] +# filelock has public domain license without restrictions +# see https://github.com/tox-dev/py-filelock +filelock = ">=3" +# cons is under LGPL-3 +cons = ">=0.4.5" +# namex is under Apache 2.0 see https://github.com/fchollet/namex?tab=License-1-ov-file +namex = "==0.0.8" diff --git a/queens/data_processor/data_processor_ensight.py b/queens/data_processor/data_processor_ensight.py index 32edc152..8be1d016 100644 --- a/queens/data_processor/data_processor_ensight.py +++ b/queens/data_processor/data_processor_ensight.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -445,6 +445,7 @@ def _vtk_from_ensight(self, raw_data, target_time): """Load a vtk-object from the ensight file. Args: + raw_data (obj): Raw data from file target_time (float): Time the field should be evaluated on Returns: @@ -488,7 +489,7 @@ def read_geometry_coordinates(external_geometry): This method uses the QUEENS external geometry module. Args: - external_geometry_obj (queens.fourc_dat_geometry) + external_geometry (queens.fourc_dat_geometry): QUEENS external geometry object Returns: dict: set with 4C topology diff --git a/queens/data_processor/data_processor_ensight_interface.py b/queens/data_processor/data_processor_ensight_interface.py index 7d9bd6d7..c4d760a0 100644 --- a/queens/data_processor/data_processor_ensight_interface.py +++ b/queens/data_processor/data_processor_ensight_interface.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -442,6 +442,7 @@ def deformed_grid(self, raw_data, time): such that the final result is the deformed grid at the specified time. Args: + raw_data (obj): Raw data from file time (float): Time value for data processing Returns: diff --git a/queens/external_geometry/fourc_dat_geometry.py b/queens/external_geometry/fourc_dat_geometry.py index 99933766..732c8622 100644 --- a/queens/external_geometry/fourc_dat_geometry.py +++ b/queens/external_geometry/fourc_dat_geometry.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -1153,7 +1153,7 @@ def _get_my_topology(self, geo_set_name_type): I.e.e its node mappings, based on the type of the geometric set. Args: - geo_set_name_type: + geo_set_name_type (str): Name of the geometric set type. Returns: my_topology (lst): List with desired geometric topology diff --git a/queens/interfaces/bmfmc_interface.py b/queens/interfaces/bmfmc_interface.py index c89d430d..a586dd88 100644 --- a/queens/interfaces/bmfmc_interface.py +++ b/queens/interfaces/bmfmc_interface.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -61,6 +61,8 @@ def evaluate(self, samples, support="y", full_cov=False, gradient_bool=False): *support=f* the Gaussian process predicts w.r.t. the latent function *f*. For the choice of *support=y* we predict w.r.t. the simulation/experimental output *y* + full_cov (bool): Boolean that specifies whether the entire posterior covariance matrix + should be returned or only the posterior variance gradient_bool (bool): Flag to determine whether the gradient of the function at the evaluation point is expected (*True*) or not (*False*) diff --git a/queens/iterators/bmfia_iterator.py b/queens/iterators/bmfia_iterator.py index d057d890..ae6b3f7a 100644 --- a/queens/iterators/bmfia_iterator.py +++ b/queens/iterators/bmfia_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -397,6 +397,7 @@ def _get_coord_features(self, _, y_lf_mat, coords_mat): and colum-wise variable dimensions. y_lf_mat (np.array): Low-fidelity output matrix with row-wise model realizations. Columns are different dimensions of the output. + coords_mat (np.array): Coordinates matrix. Returns: z_mat (np.array): Extended low-fidelity matrix containing @@ -454,7 +455,7 @@ def _get_no_features(self, _x_mat, y_lf_mat, __): def _get_time_features(self, _, y_lf_mat, __): """Get the low-fidelity feature matrix with time features. - Args: + Args: y_lf_mat (np.array): Low-fidelity output matrix with row-wise model realizations. Columns are different dimensions of the output. diff --git a/queens/iterators/hmc_iterator.py b/queens/iterators/hmc_iterator.py index 459140c5..78191525 100644 --- a/queens/iterators/hmc_iterator.py +++ b/queens/iterators/hmc_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -131,8 +131,6 @@ def __init__( def init_mcmc_method(self): """Init the PyMC MCMC Model. - Args: - Returns: step (obj): The MCMC Method within the PyMC Model """ diff --git a/queens/iterators/metropolis_hastings_pymc_iterator.py b/queens/iterators/metropolis_hastings_pymc_iterator.py index 306bf158..e7106789 100644 --- a/queens/iterators/metropolis_hastings_pymc_iterator.py +++ b/queens/iterators/metropolis_hastings_pymc_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -168,8 +168,6 @@ def eval_log_likelihood_grad(self, samples): def init_mcmc_method(self): """Init the PyMC MCMC Model. - Args: - Returns: step (obj): The MCMC Method within the PyMC Model """ diff --git a/queens/iterators/pymc_iterator.py b/queens/iterators/pymc_iterator.py index d69f6f29..a6e6b5be 100644 --- a/queens/iterators/pymc_iterator.py +++ b/queens/iterators/pymc_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -157,7 +157,7 @@ def __init__( def eval_log_prior(self, samples): """Evaluate natural logarithm of prior at samples of chains. - Args: + Args: samples (np.array): Samples to evaluate the prior at Returns: diff --git a/queens/iterators/sequential_monte_carlo_chopin.py b/queens/iterators/sequential_monte_carlo_chopin.py index f3e5b1ba..64a4d278 100644 --- a/queens/iterators/sequential_monte_carlo_chopin.py +++ b/queens/iterators/sequential_monte_carlo_chopin.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -324,7 +324,7 @@ def ppf(self, u): """Ppf of the distribution. Args: - x (np.ndarray): Input locations + u (np.ndarray): Input locations Returns: np.ndarray: ppf values diff --git a/queens/iterators/sobol_index_gp_uncertainty_iterator.py b/queens/iterators/sobol_index_gp_uncertainty_iterator.py index d726087a..8dac3d9a 100644 --- a/queens/iterators/sobol_index_gp_uncertainty_iterator.py +++ b/queens/iterators/sobol_index_gp_uncertainty_iterator.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -100,6 +100,7 @@ def __init__( num_procs (int, opt): number of processors second_order (bool, opt): true if second-order indices are calculated third_order (bool, opt): true if third-order indices only are calculated + additional_options: Additional keyword arguments. """ super().__init__(model, parameters, global_settings) diff --git a/queens/models/surrogate_models/utils/kernel_utils_jitted.py b/queens/models/surrogate_models/utils/kernel_utils_jitted.py index 2e2356f8..65f4c8ce 100644 --- a/queens/models/surrogate_models/utils/kernel_utils_jitted.py +++ b/queens/models/surrogate_models/utils/kernel_utils_jitted.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -37,7 +37,7 @@ def squared_exponential(x_train_mat, hyper_param_lst): Args: x_train_mat (np.array): Training input points for the GP. Row-wise samples are stored, different columns correspond to different input dimensions. - hyper_params_lst (lst): List with the hyper-parameters for the kernel + hyper_param_lst (lst): List with the hyper-parameters for the kernel Returns: k_mat (np.array): Assembled covariance matrix of the GP @@ -191,7 +191,7 @@ def posterior_var_squared_exponential( columns correspond to different dimensions. x_train_mat (np.array): Training input points for the GP. Individual samples row-wise, columns correspond to different dimensions. - hyper_param_lst + hyper_param_lst (lst): List with the hyper-parameters of the kernel support (str): Support type for the posterior distribution. For 'y' the posterior is computed w.r.t. the output data; For 'f' the GP is computed w.r.t. the latent function f. @@ -235,7 +235,7 @@ def grad_posterior_var_squared_exponential( columns correspond to different dimensions. x_train_mat (np.array): Training input points for the GP. Individual samples row-wise, columns correspond to different dimensions. - hyper_param_lst + hyper_param_lst (lst): List with the hyper-parameters of the kernel Returns: grad_posterior_variance (np.array): Gradient of the posterior variance @@ -333,7 +333,7 @@ def matern_3_2(x_train_mat, hyper_param_lst): Args: x_train_mat (np.array): Training input points for the GP. Row-wise samples are stored, different columns correspond to different input dimensions. - hyper_params_lst (lst): List with the hyper-parameters for the kernel + hyper_param_lst (lst): List with the hyper-parameters for the kernel Returns: k_mat (np.array): Assembled covariance matrix of the GP @@ -450,7 +450,7 @@ def posterior_var_matern_3_2( columns correspond to different dimensions. x_train_mat (np.array): Training input points for the GP. Individual samples row-wise, columns correspond to different dimensions. - hyper_param_lst + hyper_param_lst (lst): List with the hyper-parameters of the kernel support (str): Support type for the posterior distribution. For 'y' the posterior is computed w.r.t. the output data; For 'f' the GP is computed w.r.t. the latent function f. diff --git a/queens/utils/input_to_script.py b/queens/utils/input_to_script.py index 2458f9d4..7c7276d6 100644 --- a/queens/utils/input_to_script.py +++ b/queens/utils/input_to_script.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -365,6 +365,7 @@ def get_module_class(module_options, valid_types, code, module_type_specifier="t Args: module_options (dict): Module options valid_types (dict): Dict of valid types with corresponding module paths and class names + code (QueensPythonCode): Object to store the code in module_type_specifier (str): Specifier for the module type Returns: diff --git a/queens/utils/remote_operations.py b/queens/utils/remote_operations.py index 1b75f4cd..a0900c80 100644 --- a/queens/utils/remote_operations.py +++ b/queens/utils/remote_operations.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -117,7 +117,9 @@ def run_function(self, func, *func_args, wait=True, **func_kwargs): Args: func (Function): function that is executed + func_args: Additional arguments for the functools.partial function wait (bool): Flag to decide whether to wait for result of function + func_kwargs: Additional keyword arguments for the functools.partial function Returns: return_value (obj): Return value of function """ diff --git a/queens/utils/rsync.py b/queens/utils/rsync.py index 87c69229..6340a47d 100644 --- a/queens/utils/rsync.py +++ b/queens/utils/rsync.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -45,7 +45,7 @@ def assemble_rsync_command( verbose (bool): true for verbose rsh (str): remote ssh command host (str): host where to copy the files to - rsync_options (list): additional rsync options + rsync_options (list): additional rsync options Returns: str command to run rsync diff --git a/queens/variational_distributions/full_rank_normal.py b/queens/variational_distributions/full_rank_normal.py index b75109bf..e1d31f00 100644 --- a/queens/variational_distributions/full_rank_normal.py +++ b/queens/variational_distributions/full_rank_normal.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -147,7 +147,7 @@ def draw(self, variational_parameters, n_draws=1): Args: variational_parameters (np.ndarray): Variational parameters - n_draw (int): Number of samples to draw + n_draws (int): Number of samples to draw Returns: samples (np.ndarray): Row-wise samples of the variational distribution diff --git a/queens/variational_distributions/joint.py b/queens/variational_distributions/joint.py index 8b08cf71..c3c9af4e 100644 --- a/queens/variational_distributions/joint.py +++ b/queens/variational_distributions/joint.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -169,6 +169,7 @@ def _zip_variational_parameters_distributions_samples(self, variational_paramete Args: variational_parameters (np.ndarray): Variational parameters + samples (np.ndarray): Row-wise samples Returns: zip: of variational parameters, samples and distributions diff --git a/queens/variational_distributions/mean_field_normal.py b/queens/variational_distributions/mean_field_normal.py index ad971f00..14123cda 100644 --- a/queens/variational_distributions/mean_field_normal.py +++ b/queens/variational_distributions/mean_field_normal.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -112,7 +112,7 @@ def reconstruct_distribution_parameters(self, variational_parameters): def _grad_reconstruct_distribution_parameters(self, variational_parameters): """Gradient of the parameter reconstruction. - Args: + Args: variational_parameters (np.ndarray): Variational parameters Returns: diff --git a/queens/variational_distributions/mixture_model.py b/queens/variational_distributions/mixture_model.py index 85cbc88d..7f43d196 100644 --- a/queens/variational_distributions/mixture_model.py +++ b/queens/variational_distributions/mixture_model.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -92,7 +92,7 @@ def construct_variational_parameters(self, component_parameters_list, weights): Args: component_parameters_list (list): List of the component parameters of the components - probabilities (np.ndarray): Probabilities of the distribution + weights (np.ndarray): Probabilities of the distribution Returns: variational_parameters (np.ndarray): Variational parameters diff --git a/queens/visualization/classification.py b/queens/visualization/classification.py index 34119ccc..e83d493d 100644 --- a/queens/visualization/classification.py +++ b/queens/visualization/classification.py @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -# Copyright (c) 2024, QUEENS contributors. +# Copyright (c) 2025, QUEENS contributors. # # This file is part of QUEENS. # @@ -277,6 +277,7 @@ def from_estimator( ylabel (str, optional): Label for the y-axis. Defaults to None. axes (Matplotlib axes, optional): Axes object to plot on. If `None`, a new figure and axes is created. Defaults to None. + kwargs: Additional keyword arguments for DecisionBoundaryDisplay parent class Returns: sklearn.inspection.DecisionBoundaryDisplay object