Skip to main content

Map of Objects---essential parts

Project description

PyPI Status MainTests codecov Code style: black

Mapof

This open-source, MIT-licensed package is a core part of the Mapof ecosystem. This framework allow for representing various features of (computational) problem instances in the context of the instance structure in a visually appealing way. Mapof is a direct successor of mapel, which will be deprecated in the (unforeseen) future.

Mapel is abandoned, long live Mapof!!!

We've successively substituted mapel packages present when we decided to start Mapof and have abandoned active development of mapel. Here is a map of the old and new projects:

  1. mapel-core ==> Mapof
  2. mapel-elections ==> Mapof-elections
  3. mapel-roommates ==> Mapof-roommates
  4. mapel-marriagess ==> Mapof-marriages

Hence, this package, Mapof, is a direct successor of mapel-core.

Installation of Mapof

There are in principle three (standard to python packages) ways to install Mapof. We strongly recommend installing the package from PyPi but you can also: use the code as a local package or install the package from the local code using some package manager.

Installation from PyPi

We recommend installing Mapof in a separate virtual environment (we use venv but any reasonable environment manager should do). Installation from Pypi with one of Python's package managers allows a seamless usage of Mapof with its remaining modules, that are to come soon, which all declare Mapof as dependency. A drawback is here that one cannot edit the Mapof code easily. If you use pip type pip install mapof to get the newest version and your are ready to go. If you use other package managers, do whatever it usually takes to install packages from PyPi.

[!TIP] You can still patch Mapof using the fact that functions are First-Class Citizens in Python. By separating changes from the actual Mapof code, the changes can later be easily changed to pull requests. And we would be very happy if you contribute to Mapof. For details, see the section below.

Patching installation from PyPi

To patch function mapof.bar.foo you can define your own function my_foo and then assign it using mapof.bar.foo = mapof.bar.my_foo. If you do this before calling mapof.bar.foo, then each call to mapof.bar.foo will actually run your my_foo function.

Using code locally without package managers

Using the code as a local package is another option. Doing so, by downloading the package and importing different modules directly, comes with an easy way to edit Mapof files. However, it enforces usage of all other Mapof packages in the very same way. Trying installing other packages via some package manger will most likely result in that you will be using the manager-downloaded PyPi version of the Mapof module instead of your handcrafted one (there are workarounds, but you probably know these tricks very well if you ever want to take this path).

Using code locally with package manager

A somewhat compromise solution is to fork the repo and install the package into the package management system using your locally stored (perhaps edited) code. This might have a drawback that you need to update your installation after every change you make in the Mapof code.

However pip offers a handy solution here, the editable mode. Overall, using pip you can pass to pip install the path to the project (where pyproject.toml resides) and the -e switch. By this you get the best of two worlds Mapof is managed by pip and your modifications of the package are reflected immediately in the code that uses Mapof. This approach also have its limitations but in most cases it should just work well. In case you experience troubles, you should see what the pip documentation has to say about the editable mode.

Documentation

The complete documentation is available here.

Contribution

Feel free to contribute to Mapof using pull requests. We use black to enforce a coherent code style.

Acknowledgments

This project is part of the PRAGMA project which has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 101002854).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapof-0.1.3.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

mapof-0.1.3-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file mapof-0.1.3.tar.gz.

File metadata

  • Download URL: mapof-0.1.3.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mapof-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6770eb8fa258b2ae16b92be1b4f5437462e2c7c57103af51528b60228d157a84
MD5 5f1e6def20de4ed7d90d2e7e63cf3e81
BLAKE2b-256 31ea2e4b9fa1bb0b023495174dd582582ff8a69ca767db527ba9ff2c2d382967

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapof-0.1.3.tar.gz:

Publisher: pypi-publish.yml on science-for-democracy/mapof

Attestations:

File details

Details for the file mapof-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mapof-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mapof-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d90e86f44ca8171ab043213ed9f30aeb31fb09cde761cbc316306b1b014de7d4
MD5 d57415f3add0019915f8a6a6fcba0ca3
BLAKE2b-256 da1fc21d99e3f073f7149811b4d9629910cc2bb96da1c9262041296c5db636fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for mapof-0.1.3-py3-none-any.whl:

Publisher: pypi-publish.yml on science-for-democracy/mapof

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page