Giter Club home page Giter Club logo

Comments (18)

geoffreyp avatar geoffreyp commented on June 26, 2024

There is an example script. Although, I would expect to see several examples that will demonstrate the major components of the software.

I made the choice to propose only one complete example with the initialization of a problem and an algorithm, the execution of an algorithm, the saving of the results and the extraction of information. Would you prefer that I decompose it into several examples?

I think that a user guide is missing. User tutorials have been added but I think that they need polishing.

What kind of information would you like to see in a user guide?

The code coverage is great 95%. Although, as I can see the tests cover only the happy path. For instance if you pass not expected types the user should guess what is happening.

I don't understand the request. Do you have an example of a test to add? The information about the expected types are in the documentation for each function.

Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support

I cannot see (2) and (3)

This information is available in the Readme and in the documentation :

image

from framework.

chkoar avatar chkoar commented on June 26, 2024

(1)
I would like to see specific examples that will show the value of the library. Take an example what we are discussing here. Create a new variant without being limited by the software and show the performance benefit using the new variant. Sphinx-Gallery might help you to show this.

(2)
DEAP makes a walk though in their basic tutorials showing how each component can be used in order to solve a real optimization problem.

(3)

I don't understand the request. Do you have an example of a test to add? The information about the expected types are in the documentation for each function.

I was trying to say that the happy path is not always enough.

In [8]: KnapsackProblem(1,10)

OSError: [Errno 6] Device not configured

(4)
Sorry I missed this. I was looking on the documentation pages here. Could you please also add the information there? There are no links.

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

New examples are available in the PR : #72
The user guide is available in the PR #73
The page contributing was updated with information from README.md

from framework.

chkoar avatar chkoar commented on June 26, 2024

New examples are available in the PR : #72
The user guide is available in the PR #73
The page contributing was updated with information from README.md

Can you please render the updated documentation?

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

To render the documentation, I have to merge the PR in Master.
The documentation can be generated locally if you want check changes. The documentation is generated with sphinx 2.4.4 (see the section 'Requirements for developers' of the README).

You can generate the documentation with the following commands :

cd docs/

make html

from framework.

chkoar avatar chkoar commented on June 26, 2024

This issue raise concerns regarding 4 checks. Can you please point me where (PR/branch) each concern is addressed? Thanks.

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

New examples are available in the PR : #72 (merged by error when the issue #69 was closed)
The user guide is available in the PR #73
The contributing page is updated in the PR #73

For the last check :

The code coverage is great 95%. Although, as I can see the tests cover only the happy path. For instance if you pass not expected types the user should guess what is happening.

do you have a recommendation for this? Do I have to test each type of parameter, even if types are specified in the documentation?

from framework.

chkoar avatar chkoar commented on June 26, 2024

do you have a recommendation for this?

hypothesis (and mutmut) might help you in this regard.

Do I have to test each type of parameter, even if types are specified in the documentation?

Since you are in the process of publishing the library I think that you should validate each parameter (for value or/and type) and raise a human friendly error message.

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

Each parameter of Problem and Moead are tested in the PR #77

from framework.

chkoar avatar chkoar commented on June 26, 2024

The following test fails but the message is misleading

def test_that_zdt1_size():
    from moead_framework.problem.numerical import Zdt1
    Zdt1(1)

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

The following test fails but the message is misleading

The message is updated in #77

from framework.

chkoar avatar chkoar commented on June 26, 2024

Can you please merge all remaining PRs to a review branch?
I have checked everything. Can you please test for the expected errors and not only for the happy path?

from framework.

chkoar avatar chkoar commented on June 26, 2024

Can you please merge all remaining PRs to a review branch?
I have checked almost everything.
Can you please test for the expected errors and not only for the happy path?

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

I added unit tests for the unhappy/sad path in the PR #77.
All PRs (the last 4) are merged in the branch review.

from framework.

chkoar avatar chkoar commented on June 26, 2024

Great thank you.

The following seem to raise exceptions but they are not tested. Could you please add them?

GeneticOperator.number_of_solution_is_correct
DeltaSelector.__init__
SpsDra.get_sub_problems
SpsRandomAndBoundaries.get_sub_problems

In general I think that all components that are listed for public consumption should be properly tested for behavior and exceptions. So, the user should be informed accordingly. In general do not trust users input. Some examples, for instance.

# test/test_genetic_operator.py

# I am allowed to pass a string in the mutation but when I run the mutation the message is not informative
# Result: TypeError: unsupported operand type(s) for -: 'str' and 'int'
def test_binary_mutattion_example1():
    array_solution = ["a",0]
    new_solution = BinaryMutation(solutions=[array_solution]).run()

# Should this be allowed?
# Result: [0.10000000000000009, 0.3999999999999999]
def test_binary_mutattion_example2():
    array_solution = [1.1, 1.4]
    new_solution = BinaryMutation(solutions=[array_solution]).run()

# Tried to pass a single array
# Result: TypeError: object of type 'int' has no len()
def test_binary_mutattion_example3():
    array_solution = [0, 1]
    new_solution = BinaryMutation(solutions=array_solution).run()

# Tried to pass an integer
# Result: TypeError: 'int' object is not subscriptable
def test_binary_mutattion_example4():
    array_solution = [0, 1]
    new_solution = BinaryMutation(solutions=array_solution).run()

# Tried to pass empty arrays
# Result: ZeroDivisionError: division by zero
def test_binary_mutattion_example5():
    array_solution = [0, 1]
    new_solution = BinaryMutation(solutions=[[]]).run()

# Tried to ask more crossover points than the length
# Result: Infinite loop
def test_crossover_example1():
    array_solution1 = [1, 2, 3, 4, 5]
    array_solution2 = [6, 7, 8, 9, 10]
    new_solution_one_point = Crossover(solutions=[array_solution1, array_solution2],crossover_points=10).run().tolist()

# Tried to ask a zero crossover points than the length
# Result: IndexError: list index out of range
def test_crossover_example1():
    array_solution1 = [1, 2, 3, 4, 5]
    array_solution2 = [6, 7, 8, 9, 10]
    new_solution_one_point = Crossover(solutions=[array_solution1, array_solution2],crossover_points=0).run().tolist()

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

All unit tests are added on the branch review

from framework.

chkoar avatar chkoar commented on June 26, 2024

Hey @geoffreyp , I made some comments in individual commits in the review brunch. Did you get notified?

from framework.

geoffreyp avatar geoffreyp commented on June 26, 2024

I have received the notifications, I will check

from framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.