Skip to content

Commit

Permalink
Release v0.17.3 (#114)
Browse files Browse the repository at this point in the history
* chore: bump version refs to `0.17.3`

* chore: misc. fixes and improvements in the Sphinx docs, readme and contributions MD  + fix gap in validation logic in some `lib` functions

* docs: tweak sequences docs

* chore: tweak release date in citation file

* docs: fixes and improvements in the exploring continued fractions page

* chore: fix release date in citation file

* docs: further fixes and refinements in the docs for convergents and sequences
  • Loading branch information
sr-murthy authored Jul 12, 2024
1 parent f7dfede commit fa84f04
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 53 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ keywords:
- real numbers

license: MPL-2.0
version: 0.17.2
date-released: 2024-07-09
version: 0.17.3
date-released: 2024-07-12

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pdm export -v -f requirements --dev -o docs/requirements.txt
For more information on PDM lockfiles and installing requirements see
the [PDM documentation](https://pdm-project.org/latest/).

## Tests
## Tests `microscope`

Tests are defined in the `tests` folder, and should be run with
[pytest](https://pytest-cov.readthedocs.io/en/latest/).
Expand Down Expand Up @@ -200,7 +200,7 @@ PRs targeting `main`, to avoid duplication on `main`.
## Versioning and Releases

The [PyPI package](https://pypi.org/project/continuedfractions/) is
currently at version `0.17.2` - the goal is to use [semantic
currently at version `0.17.3` - the goal is to use [semantic
versioning](https://semver.org/) consistently for all future releases,
but some earlier releases do not comply with strict semantic versioning.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# continuedfractions

A simple extension of the Python [`fractions`](https://docs.python.org/3/library/fractions.html) standard library for working with [continued fractions](https://en.wikipedia.org/wiki/Continued_fraction) as Python objects.
A simple extension of the Python [`fractions`](https://docs.python.org/3/library/fractions.html) standard library for working with (finite, simple) [continued fractions](https://en.wikipedia.org/wiki/Continued_fraction) as Python objects.

The [PyPI package](https://pypi.org/project/continuedfractions/) is updated as necessary with improvements, features and fixes. Only standard libraries are used, and the package can be installed on any **Linux**, **Mac OS** or **Windows** system supporting **Python 3.10**, **3.11**, or **3.12**.
```shell
Expand All @@ -41,7 +41,7 @@ Currently, it does **not** support the following features:
* infinite and generalised continued fractions
* symbolic representations of or operations with continued fractions

These are [planned](https://github.com/sr-murthy/continuedfractions/issues) for future releases.
Some - but not necessarily all - of these features may be considered for [future release](https://github.com/sr-murthy/continuedfractions/issues).

The project is [licensed](LICENSE) under the [Mozilla Public License 2.0](https://opensource.org/licenses/MPL-2.0).

Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The package is designed for users interested in:
* infinite and generalised continued fractions
* symbolic representations of or operations with continued fractions

These are `planned <https://github.com/sr-murthy/continuedfractions/issues>`_ for future releases.
Some - but not necessarily all - of these features may be considered for `future release <https://github.com/sr-murthy/continuedfractions/issues>`_.

Interested users can :doc:`start here <sources/getting-started>`, or go straight to the :doc:`API reference <sources/api-reference>`. If you're interested in contributing you can start with the :doc:`contributions guide <sources/contributing>`.

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The CI/CD pipelines are defined in the `CI YML <https://github.com/sr-murthy/con
Versioning and Releases :fas:`upload`
=====================================

The `PyPI package <https://pypi.org/project/continuedfractions/>`_ is currently at version ``0.17.2`` - the goal is to use `semantic versioning <https://semver.org/>`_ consistently for all future releases, but some earlier releases do not comply with strict semantic versioning.
The `PyPI package <https://pypi.org/project/continuedfractions/>`_ is currently at version ``0.17.3`` - the goal is to use `semantic versioning <https://semver.org/>`_ consistently for all future releases, but some earlier releases do not comply with strict semantic versioning.

There is currently no dedicated pipeline for releases - both `GitHub releases <https://github.com/sr-murthy/continuedfractions/releases>`_ and `PyPI packages <https://pypi.org/project/continuedfractions>`_ are published manually, but both have the same version tag.

Expand Down
16 changes: 14 additions & 2 deletions docs/sources/creating-continued-fractions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ The :py:class:`~continuedfractions.continuedfraction.ContinuedFraction` instance

But passing a numeric literal such as ``649/200`` will result in an evaluation of the decimal integer division using `binary floating point division <https://docs.python.org/3/tutorial/floatingpoint.html>`_, thus producing a fractional approximation, in this case, ``ContinuedFraction(3653545197704315, 1125899906842624)``.

The elements of ``ContinuedFraction(649, 200)`` can be obtained via the :py:attr:`~continuedfractions.continuedfraction.ContinuedFraction.elements` property, which returns a tuple of non-negative integers, and the order :math:`3` via the :py:attr:`~continuedfractions.continuedfraction.ContinuedFraction.order` property:

.. code:: python
>>> cf = ContinuedFraction(649, 200)
>>> cf.elements
(3, 4, 12, 4)
>>> cf.order
3
For more details on the elements and order properties see :ref:`this <exploring-continued-fractions.elements-and-orders>`.

The float value of ``ContinuedFraction(649, 200)`` is available via the :py:meth:`~continuedfractions.continuedfraction.ContinuedFraction.as_float()` method, in this case, a value of :math:`3.245`.

.. code:: python
Expand Down Expand Up @@ -382,15 +394,15 @@ To understand the difference in the sequence of elements between a "positive" an
&= [a_0 = q; a_1, \ldots, a_n]
\end{align}
where :math:`R_1 = [a_1; a_2, \ldots, a_n]` is the "residual", :math:`(n - 1)`-order simple continued fraction of :math:`\frac{b}{v}`, also called the :ref:`1st remainder <exploring-continued-fractions.remainders>` of the continued fraction :math:`[a_0;a_1,\ldots,a_n]` of :math:`\frac{a}{b}`. If :math:`v = 1` then :math:`R_1 = [b;]` and :math:`[q; b]` is the simple continued fraction of :math:`\frac{a}{b}`. However, if :math:`v > 1` then :math:`R_1` is defined and :math:`\frac{1}{R_1}` is a symbolic expression for the rational number which is the (multiplicative) inverse of the rational number represented by :math:`R_1`.
where :math:`R_1 = [a_1; a_2, \ldots, a_n]` is the "residual", :math:`(n - 1)`-order simple continued fraction of :math:`\frac{b}{v}`, also called the :ref:`1st remainder <exploring-continued-fractions.remainders>` of the continued fraction :math:`[a_0;a_1,\ldots,a_n]` of :math:`\frac{a}{b}`. If :math:`v = 1` then :math:`R_1 = [b;]` and :math:`[q; b]` is the simple continued fraction of :math:`\frac{a}{b}`. However, if :math:`v > 1` then :math:`R_1` is defined and :math:`\frac{1}{R_1}` is the inverted continued fraction of the rational number represented by :math:`R_1`.

.. _creating-continued-fractions.basic-rules:

.. note::

For integers :math:`0 < b < a`, if :math:`\frac{a}{b}` (:math:`> 1`) has the simple continued fraction :math:`[a_0; a_1, \ldots, a_n]` of order :math:`n`, then :math:`0 < \frac{b}{a} < 1` has the "inverted" simple continued fraction :math:`[0; a_0, a_1, \ldots, a_n]` of order :math:`n + 1`. Both are unique if :math:`a_n > 1`.

Also, if :math:`m` is any integer then :math:`m + [a_0;a_1,\ldots, a_n] = [a_0;a_1,\ldots, a_n] + m` is a symbolic expression for :math:`[m;] + [a_0;a_1,\ldots, a_n] = [a_0;a_1,\ldots, a_n] + [m;] = [a_0 + m;a_1,\ldots, a_n]`, where :math:`[m;]` is the continued fraction of :math:`m`.
Also, if :math:`m` is any integer then :math:`m + [a_0;a_1,\ldots, a_n] = [a_0;a_1,\ldots, a_n] + m` denotes the continued fraction :math:`[m;] + [a_0;a_1,\ldots, a_n] = [a_0;a_1,\ldots, a_n] + [m;] = [a_0 + m;a_1,\ldots, a_n]`, where :math:`[m;]` is the continued fraction of :math:`m`.

We can write :math:`-a = -(qb + v)` as:

Expand Down
Loading

0 comments on commit fa84f04

Please sign in to comment.