semvec/pypi-packages huggingface dataset:
56kyle-pychess 0.4.0
A python chess engine
License: MIT
Requires Python: >=3.10,<4.0
Keywords: chess,python,engine


# Pychess

[![Status][status badge]][status badge]
[![Tests][github actions badge]][github actions page]
[![Codecov][codecov badge]][codecov page]
[![Python Version][python version badge]][github page]
[![License][license badge]][license]

[code of conduct]: https://github.com/56kyle/pychess/blob/master/CODE_OF_CONDUCT.md
[codecov badge]: https://codecov.io/gh/56kyle/pychess/branch/master/graph/badge.svg?token=0QDENTNTN7
[codecov page]: https://app.codecov.io/gh/56kyle/pychess/branch/master
[contributor covenant badge]: https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg
[github actions badge]: https://github.com/56kyle/pychess/workflows/Tests/badge.svg
[github actions page]: https://github.com/56kyle/pychess/actions?workflow=Tests
[github page]: https://github.com/56kyle/pychess
[license badge]: https://img.shields.io/github/license/56kyle/pychess
[license]: https://opensource.org/licenses/MIT
[python version badge]: https://img.shields.io/pypi/pyversions/56kyle-pychess
[status badge]: https://img.shields.io/pypi/status/56kyle-pychess

A chess library written in Python.


[Pychess](#Pychess)
    - [Description](#Description)
    - [Installation](#Installation)
    - [Usage](#Usage)
        - [Game](#Game)
        - [Board](#Board)
        - [Move](#Move)
        - [Piece](#Piece)
        - [Player](#Player)
        - [Square](#Square)
    - [Contributing](#Contributing)
    - [License](#License)


## Installation
    
    ```bash
    # Install from PyPI
    pip install 56kyle-pychess

    # Install from poetry
    poetry add 56kyle-pychess
    ```

## Description
The main purpose of this library is to try and practice constantly improving the quality of a codebase instead of allowing complexity to grow with time.

I was mainly inspired by the books "Clean Code" and "Clean Coder" both written by Robert C. Martin. Most of the code in this library is written with the principles of clean code in mind.

### General Design Decisions
- The Board class is immutable. This means that every time a move is made, a new board is created. This is to prevent the board from being in an invalid state.
- Moves and most geometry related classes are described in terms of Points and Lines
- Almost all iterables are sets to allow for hash comparisons of various frozen dataclass based objects

### Simplifications
- The board may not be infinite
- The board must be a rectangle


## Features
- [ ] API
    - [ ] Game
    - [x] Board
    - [ ] Move
    - [x] Piece
    - [x] Player
    - [x] Square
- [ ] Engine
- [ ] UCI
- [ ] GUI
- [ ] Documentation

## Usage
### Game
    TODO
### Board
    TODO
### Move
    TODO
### Piece
    TODO
### Player
    TODO
### Square
    TODO
WMM 0.1.0
Collection of generalized mean models with classic, fuzzy and un-weighted approach
License: MIT

Unweighted VIKOR method
=======================

The Un-Weighted VIseKriterijumska Optimizacija I Kompromisno Resenje (uwVIKOR) ranks decision alternatives based on the classical VIKOR approach, however this method does not require the introduction of a priori weights.

As a consequence of working with unknown weights, the method does not take into account the relative importance of criteria. Then, the positive ideal solution (PIS) and a negative ideal solution (NIS) varies depending on the conditions of problem. Hence, the functions of relative proximity (Q) is an operator which are optimized as two mathematical programming problems of maximize (Q_L) and minimize (Q_U), considering weights as variables. Finally, per each alternative, we get the intervals [Q_L, Q_U], and so [S_L, S_U] and [R_L, R_U], hence we can rank them in accordance with a determined comparison method.

Installation
======================

You can install the uwVIKOR library from GitHub::

    git clone https://github.com/Aaron-AALG/uwVIKOR.git
    python3 -m pip install -e uwVIKOR


You can also install it directly from PyPI::

    pip install uwVIKOR


Input-Output
======================

Input
------

* **data**: dataframe which contains the alternatives and the criteria.
* **directions**: array with the optimal direction of the criteria.
* **L**: array with the lower bounds of the weigths.
* **U**: array with the upper bounds of the weigths.
* **v**: value of the utility parameter. (By default v = 0.5)
* **w0**: array with the initial guess of the weights. (By default w0 = [])
* **display**: logical argument to indicate whether to show print convergence messages or not. (By default display = False)

Output
------

Dictionary which contains three keys:

* **Ranking**: List with S, R and Q scores in regard of the optimal weights.
* **Weights_min**: List with the weights that minimizes the Q score.
* **Weights_max**: List with the weights that maximizes the Q score.

Example
======================

uwVIKOR is implemented in order to manage **Pandas** DataFrames as input data which will be converted to **NumPy** arrays. Here is an example in which we only use three alternatives and four criteria::

    import pandas as pd
    import numpy as np
    from uwVIKOR.uwVIKOR import *

    data = pd.DataFrame({"c1":[173, 176, 142],
                        "c2":[10, 11, 5],
                        "c3":[11.4, 12.3, 8.2],
                        "c4":[10.01, 10.48, 7.3]})
    directions = ["max", "max", "min", "min"]
    L = np.array([0.1 for _ in range(data.shape[1])])
    U = np.array([0.4 for _ in range(data.shape[1])])
    v = 0.75

    x = uwVIKOR(data, directions, L, U, v)


Optimization in Python
======================

This library uses the `minimize <https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html>`_ function of the scipy.optimize module to carry out the optimization problems. In particular, Q_L and Q_U are obtained one by one, thus we can apply the **SLSQP** method.