Crypto-TII / CryptographicEstimators

This project gathers and standardize command line scripts to estimate the difficulty of solving hard mathematical problems related to cryptography.
https://estimators.crypto.tii.ae/
GNU General Public License v3.0
34 stars 5 forks source link

Refactor/python docstrings for regsd estimator #191

Closed Dioprz closed 3 weeks ago

Dioprz commented 1 month ago

Description

Implementation of https://github.com/Crypto-TII/CryptographicEstimators/pull/169 for RegSDEstimator.

Review process

Estimator-specific doctests

make docker-run
pytest --doctest-modules -n auto -vv cryptographic_estimators/RegSDEstimator

Cumulative test (with all the already migrated docstrings)

make docker-pytest-doctests

Pre-approval checklist

Dioprz commented 3 weeks ago

Look at how are generated the docstrings now:

image

Test with make docker-doc

All the required changes for this were added at https://github.com/Crypto-TII/CryptographicEstimators/pull/191/commits/932828b87e3e2f6ec3fc26733590573bae9b02a3.

Basically I made two changes:

    def __init__(self, n: int, k: int, w: int, memory_bound=inf, **kwargs):
        """Construct an instance of RegSDEstimator.

        Args:
            n (int): Code length.
            k (int): Code dimension.
            w (int): Error weight.
            memory_bound: Memory bound.
            **kwargs: Additional keyword arguments.
                excluded_algorithms: A list/tuple of excluded algorithms (default: None).
                nsolutions: No. of solutions.
        """

If you prefer to have this changes in another PR, let me know.

Help required

As you can see, I put the kwargs_formatter.py directly in the root of the project. I don't know if you prefer to create another directory, or put it directly into the scripts/ or docs/ directory so... Just tell me where you want it and I will apply the change. @FloydZ @Javierverbel

Javierverbel commented 3 weeks ago

198 It would be nice to change:

From:

**kwargs --
Additional keyword arguments.

To

**kwargs -- Additional keyword arguments.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Javierverbel commented 3 weeks ago

yes.