Condorcet Versions Save

Command line application and PHP library, providing an election engine with a high-level interface. Native support 20+ voting methods, easy to extend. Support simple elections with ease or billions of votes in low resource environment. Intensively tested and highly polyvalent.

v4.6.0

3 months ago

Description

Half-migration of tests to PestPHP.

Added

  • Experimental WoollyM PHP DataFrame driver.

v4.5.0

10 months ago

Description

A major release, including two new voting methods, additions to the internal API, and additions to the public API. It also comes with its fair share of refinements and fixes in various areas, notably the Console.

Added

Voting Methods

Public API

  • Results object new property Result->pairwise contain an immutable and explicit pairwise array, from the object creation.
  • Election->countVotes(), Election->countValidVoteWithConstraints(), Election->countValidVoteWithConstraints and Election->sumValidVotesWeightWithConstraints now optionally support votes filtering by tags.
  • New CondorcetElectionFormat::parameters property, an array containing raw and untouched parameters from input, including non-standard parameters.

Internal Modules API

  • New algo tool VotesDeductedApprovals
  • New FilteredPairwise object and API
  • Add a flag for preliminary support for non-deterministic methods
  • New API Vote->getContextualRankingWithCandidatesKeys(Election $election) to prevent code deduplication inside the votes method code.

Changed

Public API

  • Migrate CondorcetPHP\Condorcet\Tools\Converters\CondorcetElectionFormat class to CondorcetPHP\Condorcet\Tools\Converters\CEF\CondorcetElectionFormat
  • Fix a bug with about MaxParseIteration that triggered the exception 1 vote in advance.
  • Create new dedicated ParseVotesMaxNumberReachedException for max parsing fail.
  • Election::maxParseIteration and Election::setMaxVoteNumber are now public properties and they can be accessed or modified directly. Corresponding setter and getter methods still exists but may be deprecated with v5.0.

Console

  • Ignore duplicate candidates instead of an error at the end
  • Fix bug #147: crash on importing from ConforcetElectionFormat without pdo_sqlite extension.
  • Display separator is always semicolon, instead of commas in some cases (to avoid confusion with the input format)
  • Add a warning if only one candidate is registered

Internal changes

  • Refactoring Linkable logic and organization
  • Move Pairwise namespace

Engine

  • Fix a rare bug affecting the validity of results in some case of Election->removeAllVotes() used in conjunction with Election->allowsVoteWeight in a particular sequence. And prevent similar cases in the future. #153
  • Various optimizations & refactors

Dev

  • Skip concerned tests if pdo_sqlite is not available.
  • Add CI tests without pdo_sqlite
  • Remove the RunInSeparateProcess strategy, use BackupStaticProperties instead or refactor to don't use any of them if possible.
  • Compatibility with PestPHP

v4.4.1

10 months ago

Changed

  • Fix #147. Command line crash when importing CondorcetElectionFormat file if PDO Sqlite is not available.

Full Changelog: https://github.com/julien-boudry/Condorcet/compare/v4.4.0...v4.4.1

v4.4.0

11 months ago

Description

Add a new console command to convert an election file format to another format.

Added

  • New convert command.
  • New converter (export only) for the Civs format.

Internal changes

  • Converter now uses distinct interfaces for import and export capabilities.

v4.3.1

1 year ago

Changed

  • Force Terminal Ansi24 (truecolor) for Docker build instead of Ansi4.

v4.3.0

1 year ago

Description

Require PHP 8.2. Include a new random vote generator API. Provide some devcontainers for dev and command line usage.

Added

Public API

  • New VotesRandomGenerator class providing random votes following either a reproducible or cryptographically secure scheme with many options.
  • New Election->removeAllVotes() method.
  • New Election->countRanks() method.
  • Votes objects now support the ArrayAccess interface (readonly).)

Distribution

  • New Devcontainer for prod. Very easy to execute as a command line application directly in Github Codespace.

Docs

  • New Docs directory structure.
  • New www.condorcet.io docbook replacing Github Wiki.
  • Improve Api Reference docs generator.
  • Ongoing efforts to improve documentation.

Internal changes

Engine

  • Upgrade to PHP 8.2 and use new features.
  • Add some true return type.
  • Various refactoring & cleanup.

Dev

  • New Dev Container for Dev
  • Migrate to PHPUnit 10

v4.2.2

1 year ago

Dev

  • Upgrade to PHPUnit ^10

v4.2.1

1 year ago

Changed

  • [Console] Fix issue #110 - Crash on environnement without PDO/Sqlite or with the --deactivate-file-cache option.
  • [Console] Fix a memory_limit crash despite dataHandler driver if one entry with a multiplier contains more votes than memory_limit allows.

v4.2.0

1 year ago

Description

Redesign & refactor the console. And internal improvements.

Added

  • Support for PHP 8.2
  • [Console] Redesign console, add many styles, colors, and logo.
  • [Console] Improve interactive mode.

Changed

  • [Methods] Fix a rare crash on HighestAverage methods.
  • New namespace CondorcetPHP\Condorcet\Utilsand move CondorcetUtil and VoteUtil classes to it.

Internal

  • Refactor Vote entry parser to new class CondorcetPHP\Condorcet\Utils\VoteEntryParser: Better architecture and reduced code duplication.

Dev

  • [Benchmarks] Use a random deterministic seed for generating votes. (Benchmarks now require PHP 8.2 at least)
  • [Tests] Use a random deterministic if available (PHP >= 8.2) for generating votes.
  • [Coding Style] Improve rules.

v4.1.1

1 year ago

Changed

  • Composer: Fix ext-mbstring dependency
  • HighestAverage & LargestRemainder methods: Fix a bug with an empty ranking in context (or non-valid rank in a vote)