From c4eedbc6750c36d80e643d3241225ac7975e3bd6 Mon Sep 17 00:00:00 2001 From: ajnebro Date: Sat, 22 Jun 2024 10:04:31 +0200 Subject: [PATCH] Update documentation --- docs/about.html | 203 ---- docs/contributing.html | 380 ------- docs/genindex.html | 1556 -------------------------- docs/index.html | 252 ----- docs/multiobjective.algorithms.html | 191 ---- docs/operators.html | 179 --- docs/problems.html | 191 ---- docs/py-modindex.html | 322 ------ docs/search.html | 159 --- docs/singleobjective.algorithms.html | 181 --- docs/{ => source}/about.rst | 2 +- docs/{ => source}/contributing.rst | 0 docs/tutorials.html | 190 ---- pyproject.toml | 5 + 14 files changed, 6 insertions(+), 3805 deletions(-) delete mode 100644 docs/about.html delete mode 100644 docs/contributing.html delete mode 100644 docs/genindex.html delete mode 100644 docs/index.html delete mode 100644 docs/multiobjective.algorithms.html delete mode 100644 docs/operators.html delete mode 100644 docs/problems.html delete mode 100644 docs/py-modindex.html delete mode 100644 docs/search.html delete mode 100644 docs/singleobjective.algorithms.html rename docs/{ => source}/about.rst (87%) rename docs/{ => source}/contributing.rst (100%) delete mode 100644 docs/tutorials.html diff --git a/docs/about.html b/docs/about.html deleted file mode 100644 index b606340a..00000000 --- a/docs/about.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - About — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - - -
-
-
- - - -
- -
-

About

-

jMetalPy is being developed by Antonio J. Nebro, associate professor at the University of Málaga, and Antonio Benítez-Hidalgo, PhD Student in Computer Science at the University of Málaga.

-
-

Cite us

-
@article{BENITEZHIDALGO2019100598,
-   title = "jMetalPy: A Python framework for multi-objective optimization with metaheuristics",
-   journal = "Swarm and Evolutionary Computation",
-   pages = "100598",
-   year = "2019",
-   issn = "2210-6502",
-   doi = "https://doi.org/10.1016/j.swevo.2019.100598",
-   url = "http://www.sciencedirect.com/science/article/pii/S2210650219301397",
-   author = "Antonio Benítez-Hidalgo and Antonio J. Nebro and José García-Nieto and Izaskun Oregi and Javier Del Ser",
-   keywords = "Multi-objective optimization, Metaheuristics, Software framework, Python, Statistical analysis, Visualization",
-}
-
-
-
-
-

References

-
    -
  1. J.J. Durillo, A.J. Nebro jMetal: a Java Framework for Multi-Objective Optimization. Advances in Engineering Software 42 (2011) 760-771.

  2. -
  3. A.J. Nebro, J.J. Durillo, M. Vergne Redesigning the jMetal Multi-Objective Optimization Framework. GECCO (Companion) 2015, pp: 1093-1100. July 2015.

  4. -
  5. Nebro A.J. et al. (2018) Extending the Speed-Constrained Multi-objective PSO (SMPSO) with Reference Point Based Preference Articulation. In: Auger A., Fonseca C., Lourenço N., Machado P., Paquete L., Whitley D. (eds) Parallel Problem Solving from Nature – PPSN XV. PPSN 2018. Lecture Notes in Computer Science, vol 11101. Springer, Cham

  6. -
-
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/contributing.html b/docs/contributing.html deleted file mode 100644 index e3ff4075..00000000 --- a/docs/contributing.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - - - - - - - - - Contributing — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- - - -
- -
-

Contributing

-

Contributions to the jMetalPy project are welcome. -Please, take into account the following guidelines (all developers should follow these guidelines):

-
-

Git WorkFlow

-

We have a set of branches on the remote Git server. -Some branches are temporary, and others are constant throughout the life of the repository.

-
    -
  • -
    Branches always present in the repository:
      -
    • -
      master: You have the latest released to production, receive merges from the develop branch, or merge from a hotfix branch (emergency).
        -
      • Do I have to put a TAG when doing a merge from develop to master? yes

      • -
      • Do I have to put a TAG when doing a merge from a hotfix branch to master? yes

      • -
      • After merge from a hotfix to master, do I have to merge from master to develop? yes

      • -
      -
      -
      -
    • -
    • develop: It is considered the “Next Release”, receives merges from branches of each developer, either corrections (fix) or new features (feature).

    • -
    -
    -
    -
  • -
  • -
    Temporary branches:
      -
    • -
      feature/<task-id>-<description>: When we are doing a development, we create a local branch with the prefix “feature/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are developing. The words are separated by hyphens.
        -
      • Where does this branch emerge? This branch always emerge from the develop branch

      • -
      • When I finish the development in my feature branch, which branch to merge into?: You always merge feature branch into develop branch

      • -
      -
      -
      -
    • -
    • -
      fix/<task-id>-<description>: When we are making a correction, we create a local branch with the prefix “fix/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are correcting. The words are separated by hyphens.
        -
      • Where does this branch emerge? This branch always emerge from the develop branch

      • -
      • When I finish the correction in my fix branch, which branch to merge into?: You always merge feature branch into develop branch

      • -
      -
      -
      -
    • -
    • -
      hotfix/<task-id>-<description>: When we are correcting an emergency incidence in production, we create a local branch with the prefix “hotfix/”, then only if there is a task id, we indicate it and we add a hyphen. The following we indicate a description according to the functionality that we are correcting. The words are separated by hyphens.
        -
      • Where does this branch emerge?: This branch always emerge from the master branch

      • -
      • When I finish the correction in my hotfix branch, which branch to merge into?: This branch always emerge from the master and develop branch

      • -
      -
      -
      -
    • -
    -
    -
    -
  • -
  • -
    Steps to follow when you are creating or going to work on a branch of any kind (feature / fix / hotfix):
      -
    1. After you create your branch (feature / fix / hotfix) locally, upload it to the remote Git server. The integration system will verify your code from the outset.

    2. -
    3. Each time you commit, as much as possible, you send a push to the server. Each push will trigger the automated launch of the tests, etc.

    4. -
    5. Once the development is finished, having done a push to the remote Git server, and that the test phase has passed without problem, you create an pull request.

    6. -
    -
    -
    -
  • -
-
-

Note

-

Do not forget to remove your branch (feature / fix / hotfix) once the merge has been made.

-
-

Some useful Git commands:

-
    -
  • git fetch –prune: Cleaning branches removed and bringing new branches

  • -
-
-
-

PEP8!

-

It is really important to follow some standards when a team develops an application. If all team members format the code in the same format, then it is much easier to read the code. PEP8 is Python’s style guide. It’s a set of rules for how to format your Python code.

-

Some style rules:

-
    -
  • Package and module names: Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged. In Python, a module is a file with the suffix ‘.py’.

  • -
  • Class names: Class names should normally use the CapWords convention.

  • -
  • Method names and instance variables: Lowercase with words separated by underscores as necessary to improve readability.

  • -
-

There are many more style standards in PEP8 so, please, refer to PEP8 documentation -. The most appropriate is to use an IDE that has support for PEP8. For example, PyCharm.

-
-
-

Object-oriented programming

-

Object-oriented programming should be the single programming paradigm used. Avoiding as far as possible, imperative and functional programming.

-_images/python_poo_programming.png -_images/python_functional_programming.png -_images/python_imperative_programming.png -

In classes, we directly access the attributes, which are usually defined as public.

-_images/without_getter_setter.png -

Only when we want to implement additional logic in the accesses to the attributes we define getter/setter methods, but always by using the *property* annotation or the *property* function:

-_images/property_annotation.png -_images/property_functional.png -

By using *property*, we continue to access the attributes directly:

-_images/good_access.png -

Do not use getter/setter methods without the property annotation or the property function:

-_images/with_getter_setter.png -

Since this way of accessing the attribute is not commonly used in Python:

-_images/bad_access.png -
-
-

Structure

-

Python is not Java. In Java you cannot, by design, have more than one class in a file. In Python, you can do it.

-

In Python, it is appropriate to group several classes into a single .py file. For that reason, the .py files are called modules.

-
-
-

Python 3.6

-

We always define types in the parameters of the arguments and the return value:

-_images/types_in_methods.png -

We can define abstract classes (ABCs) in Python:

-_images/abstract.png -

In the case that we want to define an interface class, it is done in the same way. We just have to define all the methods of the class as abstract.

-

Example of use of generic types:

-_images/generic_types.png -

In the code below, the IDE displays a warning, since although the 2nd parameter is a float type, which is a type allowed in the definition of the generic type X, it is not of the same type as the first, since the first 2 parameters must be of the same generic type (S):

-_images/instance_with_generic_types1_wearning.png -

In the code below, the IDE displays a warning, since the 2nd parameter is a type not allowed in the definition of the generic type ( TypeVar(‘S’, int, float) ):

-_images/instance_with_generic_types2_wearning.png -

When the class inherits from Generic[…], the class is defined as generic. In this way we can indicate the types that will have the values of the generic types, when using the class as type. Look at the add_car() method of the Parking class.

-
-

Note

-

The generic classes inherit from abc.ABCMeta, so they are abstract classes and abstract methods can be used.

-
-_images/generic_class1.png -_images/generic_class2.png -

In the code below, the IDE displays a warning in the call to the add_car() method when adding the car, since the 3rd parameter of the init must be a str type, as defined in the add_car() method of the Parking class.

-_images/instance_with_generic_class_wearning.png -

When inheriting from generic classes, some type variables could be fixed:

-_images/generic_types_fixed.png -

Example of inheritance from non-generic class to generic class:

-_images/inheritance_non_generic_to_generic.png -

Example of inheritance from generic class to another generic class:

-_images/inheritance_generic_to_generic.png -
-
-

Create automatic documentation files with Sphinx

-

First, you need to know how to correctly document your code. It is important to follow these simple rules in order to automatically create good documentation for the project.

-

When you create a new module file (testDoc.py in this example), you should mention it using this format:

-
"""
-.. module:: testDoc
-   :platform: Unix, Windows
-   :synopsis: A useful module indeed.
-
-.. moduleauthor:: Andrew Carter <andrew@invalid.com>
-"""
-
-class testDoc(object):
-    """We use this as a public class example class.
-
-    This class is ruled by the very trendy important method :func:`public_fn_with_sphinxy_docstring`.
-
-    .. note::
-       An example of intersphinx is this: you **cannot** use :mod:`pickle` on this class.
-    """
-
-    def __init__(self):
-        pass
-
-
-

This code snippet generates the following documentation:

-_images/class_header.png -

Now, you can document your methods using the following sintax:

-
def public_fn_with_sphinxy_docstring(self, name: str, state: bool = False) -> int:
-    """This function does something.
-
-    :param name: The name to use.
-    :type name: str.
-    :param state: Current state to be in.
-    :type state: bool.
-    :returns:  int -- the return code.
-    :raises: AttributeError, KeyError
-    """
-    return 0
-
-def public_fn_without_docstring(self):
-    return True
-
-
-

And the produced output doc will be:

-_images/method_way_sphinx.png -

As you may notice, if you don’t use any docstring, the method documentation will be empty.

-
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/genindex.html b/docs/genindex.html deleted file mode 100644 index c38c136c..00000000 --- a/docs/genindex.html +++ /dev/null @@ -1,1556 +0,0 @@ - - - - - - - - - - - - - - - - Index — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- - -

Index

- -
- A - | B - | C - | D - | E - | F - | G - | H - | I - | J - | K - | L - | M - | N - | O - | P - | Q - | R - | S - | T - | U - | V - | W - | Z - -
-

A

- - - -
- -

B

- - - -
- -

C

- - - -
- -

D

- - - -
- -

E

- - - -
- -

F

- - - -
- -

G

- - - -
- -

H

- - - -
- -

I

- - - -
- -

J

- - - -
- -

K

- - - -
- -

L

- - - -
- -

M

- - - -
- -

N

- - - -
- -

O

- - - -
- -

P

- - - -
- -

Q

- - - -
- -

R

- - - -
- -

S

- - - -
- -

T

- - - -
- -

U

- - - -
- -

V

- - - -
- -

W

- - -
- -

Z

- - - -
- - - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 418e259c..00000000 --- a/docs/index.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - jMetalPy: Python version of the jMetal framework — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - - -
-
-
- - - -
- -
-

jMetalPy: Python version of the jMetal framework

-
-

Warning

-

Documentation is work in progress!! Some information may be missing or incomplete.

-
- ---- - - - - - -

Target doc

v1.5.3

- -
-

Installation steps

-

Via pip:

-
$ pip install jmetalpy  # or "jmetalpy[distributed]"
-
-
-
-

Note

-

Alternatively, you can use one of these instead:

-
$ pip install "jmetalpy[core]"  # Install core components of the framework (equivalent to `pip install jmetalpy`)
-$ pip install "jmetalpy[docs]"  # Install requirements for building docs
-$ pip install "jmetalpy[distributed]"  # Install requirements for parallel/distributed computing
-$ pip install "jmetalpy[complete]"  # Install all dependencies
-
-
-
-

Via source code:

-
$ git clone https://github.com/jMetal/jMetalPy.git
-$ python setup.py install
-
-
-
-
-

Summary of features

-

The current release of jMetalPy (v1.5.3) contains the following components:

-
    -
  • Algorithms: local search, genetic algorithm, evolution strategy, simulated annealing, random search, NSGA-II, NSGA-III, SMPSO, OMOPSO, MOEA/D, MOEA/D-DRA, MOEA/D-IEpsilon, GDE3, SPEA2, HYPE, IBEA. Preference articulation-based algorithms (G-NSGA-II, G-GDE3, G-SPEA2, SMPSO/RP); Dynamic versions of NSGA-II, SMPSO, and GDE3.

  • -
  • Parallel computing based on Apache Spark and Dask.

  • -
  • Benchmark problems: ZDT1-6, DTLZ1-2, FDA, LZ09, LIR-CMOP, unconstrained (Kursawe, Fonseca, Schaffer, Viennet2), constrained (Srinivas, Tanaka).

  • -
  • Encodings: real, binary, permutations.

  • -
  • Operators: selection (binary tournament, ranking and crowding distance, random, nary random, best solution), crossover (single-point, SBX), mutation (bit-blip, polynomial, uniform, random).

  • -
  • Quality indicators: hypervolume, additive epsilon, GD, IGD.

  • -
  • Pareto front approximation plotting in real-time, static or interactive.

  • -
  • Experiment class for performing studies either alone or alongside jMetal.

  • -
  • Pairwise and multiple hypothesis testing for statistical analysis, including several frequentist and Bayesian testing methods, critical distance plots and posterior diagrams.

  • -
-
-
-

Cite us

-
@article{BENITEZHIDALGO2019100598,
-   title = "jMetalPy: A Python framework for multi-objective optimization with metaheuristics",
-   journal = "Swarm and Evolutionary Computation",
-   pages = "100598",
-   year = "2019",
-   issn = "2210-6502",
-   doi = "https://doi.org/10.1016/j.swevo.2019.100598",
-   url = "http://www.sciencedirect.com/science/article/pii/S2210650219301397",
-   author = "Antonio Benítez-Hidalgo and Antonio J. Nebro and José García-Nieto and Izaskun Oregi and Javier Del Ser",
-   keywords = "Multi-objective optimization, Metaheuristics, Software framework, Python, Statistical analysis, Visualization",
-}
-
-
-
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/multiobjective.algorithms.html b/docs/multiobjective.algorithms.html deleted file mode 100644 index 2ee60a0b..00000000 --- a/docs/multiobjective.algorithms.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - Multi-objective algorithms — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- -
-

Multi-objective algorithms

-
-

List of multi-objective algorithms:

- -
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/operators.html b/docs/operators.html deleted file mode 100644 index c5cc70d2..00000000 --- a/docs/operators.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - Operators — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- -
-

Operators

-
-

List of genetic operators:

- -
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/problems.html b/docs/problems.html deleted file mode 100644 index 0ee4d93e..00000000 --- a/docs/problems.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - Problems — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- - - - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/py-modindex.html b/docs/py-modindex.html deleted file mode 100644 index 7ef219f2..00000000 --- a/docs/py-modindex.html +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - - - - - - - - - - Python Module Index — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- - -

Python Module Index

- -
- j | - s -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- j
- jmetal -
    - jmetal.algorithm.singleobjective.evolution_strategy -
    - jmetal.algorithm.singleobjective.genetic_algorithm -
    - jmetal.algorithm.singleobjective.local_search -
    - jmetal.algorithm.singleobjective.simulated_annealing -
    - jmetal.core.observer -
    - jmetal.core.problem -
    - jmetal.lab.experiment -
    - jmetal.lab.statistical_test -
    - jmetal.lab.statistical_test.apv_procedures -
    - jmetal.lab.statistical_test.bayesian -
    - jmetal.lab.statistical_test.critical_distance -
    - jmetal.lab.statistical_test.functions -
    - jmetal.lab.visualization.chord_plot -
    - jmetal.lab.visualization.interactive -
    - jmetal.lab.visualization.plotting -
    - jmetal.lab.visualization.posterior -
    - jmetal.lab.visualization.streaming -
    - jmetal.operator.crossover -
    - jmetal.operator.mutation -
    - jmetal.operator.selection -
    - jmetal.problem.multiobjective.constrained -
    - jmetal.problem.multiobjective.dtlz -
    - jmetal.problem.multiobjective.fda -
    - jmetal.problem.multiobjective.lircmop -
    - jmetal.problem.multiobjective.lz09 -
    - jmetal.problem.multiobjective.unconstrained -
    - jmetal.problem.multiobjective.zdt -
    - jmetal.problem.singleobjective.knapsack -
    - jmetal.problem.singleobjective.tsp -
    - jmetal.problem.singleobjective.unconstrained -
    - jmetal.util.observer -
 
- s
- selection (Unix, Windows) - Module implementing selection operators.
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index bc6b585f..00000000 --- a/docs/search.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - Search — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - -
-
-
- - - -
- -

Search

-
- -

- Please activate JavaScript to enable the search - functionality. -

-
-

- From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

- -
-
-
- - - - -
- -
-
- - -
- -
- -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/singleobjective.algorithms.html b/docs/singleobjective.algorithms.html deleted file mode 100644 index f5da783f..00000000 --- a/docs/singleobjective.algorithms.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - Single-objective algorithms — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- -
-

Single-objective algorithms

-
-

List of single-objective algorithms:

- -
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/docs/about.rst b/docs/source/about.rst similarity index 87% rename from docs/about.rst rename to docs/source/about.rst index d5029674..e6d3550b 100644 --- a/docs/about.rst +++ b/docs/source/about.rst @@ -1,7 +1,7 @@ About ============== -jMetalPy is being developed by `Antonio J. Nebro `_, associate professor at the University of Málaga, and `Antonio Benítez-Hidalgo `_, PhD Student in Computer Science at the University of Málaga. +jMetalPy is being developed by `Antonio J. Nebro `_, full professor at the University of Málaga. Cite us ------------------------ diff --git a/docs/contributing.rst b/docs/source/contributing.rst similarity index 100% rename from docs/contributing.rst rename to docs/source/contributing.rst diff --git a/docs/tutorials.html b/docs/tutorials.html deleted file mode 100644 index ec19fbee..00000000 --- a/docs/tutorials.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - Getting started — jMetalPy 1.5.3 documentation - - - - - - - - - - - - - - - - - - - - -
- -
- -
-
-
- - - - - -
-
-
- - - -
- -
-

Getting started

- -
-

Laboratory:

- -
-
- - -
- - -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c9031d0a..83d260a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,11 @@ dependencies = [ "PyHamcrest" ] +[tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", +] + [project.optional-dependencies] core = [ "tqdm",