Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing docstrings #40

Merged
merged 5 commits into from
Mar 15, 2024
Merged

Add missing docstrings #40

merged 5 commits into from
Mar 15, 2024

Conversation

Flaminietta
Copy link
Collaborator

Add missing doctrings to non-private function and non-static methods (that receive only a brief description).
Some docstrings include a running example but not all.
Add minor refinements to fulfill consistency of adopted standards.

@Flaminietta Flaminietta added code quality quality of the code improved joss review related issues related to the review process for publication labels Mar 12, 2024
@Flaminietta Flaminietta self-assigned this Mar 12, 2024
@Flaminietta Flaminietta linked an issue Mar 12, 2024 that may be closed by this pull request
@Flaminietta
Copy link
Collaborator Author

@mspada @kapil-agnihotri let me take care of fixing the tests before starting your review. Failures unexpected.

@Flaminietta
Copy link
Collaborator Author

@mspada @kapil-agnihotri tests are fixed, you can start reviewing it.

@Flaminietta
Copy link
Collaborator Author

@mspada, neither Kapil nor I have been able to run pdoc successfully. Would you try it once?

@mspada
Copy link
Collaborator

mspada commented Mar 13, 2024

@Flaminietta I tried to run pdoc, but also in my case was not successful...

mcda/mcda_functions/aggregation.py Show resolved Hide resolved

Methods:
__init__(input_config: dict): instantiate a configuration object.
_validate(input_config, valid_keys, str_values, int_values, list_values, dict_values): validate the input configuration.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line will give linting error. Seems to be crossing 120.
Did you run linting on this branch?

mcda/configuration/config.py Show resolved Hide resolved
and estimates the scores over the indicators, per alternative.
Weighted-sum or additive aggregation function gets as input the normalized values of the indicators in a matrix
and estimates the scores over the indicators, per alternative. The norm_indicators has
shape = (no.alternatives x num. indicators) and the returned scores has length = num. of alternatives.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.?
num. indicators? is space indented? Either something similar to length = num. of alternatives.?

mcda/mcda_functions/aggregation.py Show resolved Hide resolved
Aggregate the normalized indicators using the specified aggregation method.

Parameters:
- normalized_indicators: a dictionary containing the normalized values of each indicator per normalization method.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linting

mcda/utils/utils_for_main.py Show resolved Hide resolved
mcda/utils/utils_for_main.py Show resolved Hide resolved
:param num_weights: int
:param num_runs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following your standards want to specify the type?


```

This example initializes an Aggregation object with the given weights and calls the specified aggregation method
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fine.

@Flaminietta Flaminietta merged commit 01e91d8 into main Mar 15, 2024
3 checks passed
@Flaminietta Flaminietta deleted the add-missing-docstrings branch March 15, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality quality of the code improved joss review related issues related to the review process for publication
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document function arguments
3 participants