This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Build Status:

The constructible module provides exact representation of constructible numbers in Python.

Python 2 and Python 3 are supported.

The constructible numbers are the smallest field containing the rational numbers, where the square root of any non-negative constructible number is constructible as well. The non-negative constructible numbers are the lengths which can be constructed from the unit length using only a compass and a straightedge.

Usage

Usually the sqrt function is enough to work with constructible numbers:

>>> from constructible import sqrt
>>> x = sqrt(2) + sqrt(3)
>>> print(x)
((0 + 1 * sqrt(2)) + (1 + 0 * sqrt(2)) * sqrt((3 + 0 * sqrt(2))))
>>> y = x*x
>>> print(y)
((5 + 0 * sqrt(2)) + (0 + 2 * sqrt(2)) * sqrt((3 + 0 * sqrt(2))))
>>> z = y*y
>>> t = 10*y - z
>>> t == 1
True

Installation

To install from PYPI just type

pip install constructible

The library is a single pure python file, so it is also easy to install by hand.

Testing

There are some tests using unittest. Thanks to Travis-CI each push to github triggers a test:

Releasing on PYPI

The following steps are needed:

  • Update the version in setup.py

  • Tag the version in git:

    git tag 0.1 -m "Adds a tag so that we can put this on PyPI."
    git push --tags origin
    
  • Test release with:

    python setup.py register -r pypitest
    python setup.py sdist upload -r pypitest
    
  • Productive release with:

    python setup.py register -r pypi
    python setup.py sdist upload -r pypi
    

Changelog

  • 2016-05-23 V0.1 Initial Release
  • 2016-09-30 V0.2 Fixing Issue 1 and added Tests
  • 2016-10-03 V0.3 Fixing Issue 2
  • 2016-10-23 V0.4 Added __hash__ and __float__, speed optimizations

Aknowledgements

Thanks to Anders Kaseorg whose implementation of constructible numbers in Haskell provided inspiration and in particular the algorithm for taking square roots in quadratic extension fields.

Release History

Release History

0.4.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
constructible-0.4.1.zip (5.3 kB) Copy SHA256 Checksum SHA256 Source Oct 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting