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

Full renaming (package/module/class) #328

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Oct 14, 2024

The goal is to have more consistency in names choices across the
library, between and even within problem type.

  • We use camel case for classes
  • For each problem,
    • the solvers are stored in a subpackage "solvers" (was sometimes "solver"),
      in a module with a short name "{technology}" without adding
      "solver" or the problem name
    • the base solver class is also in solvers, accessible directly via
      discrete_optimization.{problem}.solvers,
    • the solvers_map is accessible in discrete_optimization.{problem}.solvers_map,
    • the solver class name follow the logic {Technology}{Problem}Solver,
    • the problem class name is {Problem}Problem,
    • the solution class name is {Problem}Solution,
  • To be consistent, problem names which are acronym keeps only their
    first letter in uppercase: Rcpsp, Fjsp, Jsp, Gpdp, Vrp, Tsp
  • pickup_vrp becomes Gpdp (was already used for problem, solution and
    some solvers)
  • all CP (resp. LP) becomes generally Cp (resp. Lp), to avoid confusion
    between (formerly) CPM_RCPSP and CP_MRCPSP.
  • MRCPSP -> MultimodeRcpsp
  • RCPSP_MS -> MultiskillRcpsp

For instance the cp-sat solver for coloring can be imported via

from discrete_optimization.coloring.solvers.cpsat import CpSatColoringSolver

and the problem class via

from discrete_optimization.coloring.problem import ColoringProblem
  • tests and examples names are also harmonized (less prefix/suffix)

@nhuet nhuet force-pushed the renaming branch 3 times, most recently from d102532 to 10604cb Compare October 14, 2024 22:12
@nhuet nhuet marked this pull request as ready for review October 14, 2024 22:12
The goal is to have more consistency in names choices across the
library, between and even within problem type.

- We use camel case for classes
- For each problem,
   - the solvers are stored in a subpackage "solvers" (was sometimes "solver"),
     in a module with a short name "{technology}" without adding
     "solver" or the problem name
   - the base solver class is also in solvers, accessible directly via
     `discrete_optimization.{problem}.solvers`,
   - the solvers_map is accessible in `discrete_optimization.{problem}.solvers_map`,
   - the solver class name follow the logic `{Technology}{Problem}Solver`,
   - the problem class name is `{Problem}Problem`,
   - the solution class name is `{Problem}Solution`,
- To be consistent, problem names which are acronym keeps only their
  first letter in uppercase: Rcpsp, Fjsp, Jsp, Gpdp, Vrp, Tsp
- pickup_vrp becomes Gpdp (was already used for problem, solution and
  some solvers)
- all CP (resp. LP) becomes generally Cp (resp. Lp), to avoid confusion
  between (formerly) CPM_RCPSP and CP_MRCPSP.
- MRCPSP -> MultimodeRcpsp
- RCPSP_MS -> MultiskillRcpsp

For instance the cp-sat solver for coloring can be imported via
```
from discrete_optimization.coloring.solvers.cpsat import CpSatColoringSolver
```
and the problem class via
```
from discrete_optimization.coloring.problem import ColoringProblem
```

- tests and examples names are also harmonized (less prefix/suffix)
Copy link
Collaborator

@g-poveda g-poveda left a comment

Choose a reason for hiding this comment

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

thanks for the big work

@g-poveda g-poveda merged commit f720be0 into airbus:master Oct 15, 2024
14 checks passed
@nhuet nhuet deleted the renaming branch October 15, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants