Skip to content

Commit

Permalink
Add more corrections to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed May 23, 2024
1 parent 14b832d commit 4d6eeef
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
16 changes: 8 additions & 8 deletions docs/source/developer_zone/changes-2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ All code previously available in Python through ``import mamba`` has been remove

Libmambapy (Python bindings)
****************************
The Python bindings to the C++ ``libamamba`` library remain available through ``import libmambapy``.
The Python bindings to the C++ ``libmamba`` library remain available through ``import libmambapy``.
They are now considered the first class citizen to using Mamba in Python.
Changes include:

- The global ``Context``, previously available through ``Context()``, must now be accessed through
``Context.instance()``.
What's more, it is required to be passed explicitly in a few more functions.
Future version of ``libmambapy`` will continue in this direction until there are no global context.
In version 2, ``Context()`` will throw an exception to avoid hard to catch errors.
In version 2, ``Context()`` will throw an exception to allow catching errors more smoothly.
- ``ChannelContext`` is no longer an implicit global variable.
It must be constructed with one of ``ChannelContext.make_simple`` or
``ChannelContext.make_conda_compatible`` (with ``Context.instance`` as argument in most cases)
Expand All @@ -81,11 +81,11 @@ Changes include:
A usage documentation page is available at :ref:`mamba_usage_solver`.

- The redesign of the ``Pool``, which is now available as ``libmambapy.solver.libsolv.Database``.
The new interfaces makes it easier to create repositories without using other ``libmambapy``
The new interfaces make it easier to create repositories without using other ``libmambapy``
objects.
- ``Repo`` has been redesigned into a lightweight ``RepoInfo`` and moved to
``libmambapy.solver.libsolv``.
The creation and modification of repos happens through the ``Database``, with methods such as
The creation and modification of repos happen through the ``Database``, with methods such as
``Database.add_repo_from_repodata_json`` and ``Database.add_repo_from_packages``, but also
high-level free functions such as ``load_subdir_in_database`` and
``load_installed_packages_in_database``.
Expand All @@ -96,7 +96,7 @@ Changes include:
``libmambapy.solver.libsolv.Unsolvable`` state from which rich error messages can be
extracted.

For many changes, an exception throwing placeholder has ben kept to advise developers on the new
For many changes, an exception throwing placeholders has been kept to advise developers on the new
direction to take.

Libmamba (C++)
Expand All @@ -105,16 +105,16 @@ The C++ library ``libmamba`` has received significant changes.
Due to the low usage of the C++ interface, all changes are not listed here.
The main changes are:

- Refactoring and testing of a large number of utilities into a ``util::`` namespace,
- Creation of the ``specs::`` the items below.
- Refactoring and testing of a large number of utilities into a ``util::`` namespace.
- Creation of ``specs::`` including the items below.
A usage documentation (in Python) is available at :ref:`mamba_usage_specs`.

- Implementations of ``Version`` and ``VersionSpec`` for matching versions,
- A refactoring of a purely functional ``Channel`` class,
- Implementation of a ``UnresolvedChannel`` to describe unresolved ``Channels``,
- A refactored and complete implementation of ``MatchSpec`` using the components above.

- A cleanup of ``ChannelContext`` for be a light proxy and parameter holder wrapping the
- A cleanup of ``ChannelContext`` to be a light proxy and parameter holder wrapping the
``specs::Channel``.
- A new ``repodata.json`` parser using `simdjson <https://simdjson.org/>`_.
- The ``MPool``, ``MRepo`` and ``MSolver`` API has been completely redesigned into a ``solver``
Expand Down
16 changes: 8 additions & 8 deletions docs/source/usage/solver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Packages are organised in repositories, described by a
This serves to resolve explicit channel requirements or channel priority.
As such, the database constructor takes a set of
:cpp:type:`ChannelResolveParams <mamba::specs::ChannelResolveParams>`
to work with :cpp:type:`Channel <mamba::specs::Channel>` work with Channel data
to work with :cpp:type:`Channel <mamba::specs::Channel>` data
internally (see :ref:`the usage section on Channels <libmamba_usage_channel>` for more
information).

Expand All @@ -58,7 +58,7 @@ The first way to add a repository is from a list of |PackageInfo| using
The second way of loading packages is through Conda's repository index format ``repodata.json``
using
:cpp:func:`DataBase.add_repo_from_repodata <mamba::solver::libsolv::Database::add_repo_from_repodata>`.
This is meant as a convenience and performant alternative to the former method, since these files
This is meant for convenience, and is not a performant alternative to the former method, since these files
grow large.

.. code:: python
Expand All @@ -70,7 +70,7 @@ grow large.
One of the repositories can be set to have a special meaning of "installed repository".
It is used as a reference point in the solver to compute changes.
For instance if a package is required but is already available in the installed repo, the solving
For instance, if a package is required but is already available in the installed repo, the solving
result will not mention it.
The function
:cpp:func:`DataBase.set_installed_repo <mamba::solver::libsolv::Database::set_installed_repo>` is
Expand All @@ -88,7 +88,7 @@ such as source url and
:cpp:type:`RepodataOrigin <mamba::solver::libsolv::RepodataOrigin>`, are stored inside the
file when calling
:cpp:func:`DataBase.native_serialize_repo <mamba::solver::libsolv::Database::native_serialize_repo>` .
Upon reading, similar parameters are expected as input to
Upon reading, similar parameters are expected as inputs to
:cpp:func:`DataBase.add_repo_from_native_serialization <mamba::solver::libsolv::Database::add_repo_from_native_serialization>`.
If they mismatch, the loading results in an error.

Expand Down Expand Up @@ -120,7 +120,7 @@ This includes installing, updating, removing packages, as well as solving cutomi
Solving the request
-------------------
The |Request| and the |Database| are the two input parameters needed to solve an environment.
This task is achieve with the :cpp:func:`Solver.solve <mamba::solver::libsolv::Solver::solve>`
This task is achieved with the :cpp:func:`Solver.solve <mamba::solver::libsolv::Solver::solve>`
method.

.. code:: python
Expand All @@ -129,7 +129,7 @@ method.
outcome = solver.solve(db, request)
The outcome can be of two types, either a |Solution| listing packages (|Packageinfo|) and the
action to take on them (install, remove...), or an |UnSolvable| type when no solution exist
action to take on them (install, remove...), or an |UnSolvable| type when no solution exists
(because of conflict, missing packages...).

Examine the solution
Expand Down Expand Up @@ -168,10 +168,10 @@ Alternatively, an easy way to compute the update to the environment is to check
Understand unsolvable problems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When a problem as no |Solution|, it is inherenty hard to come up with an explanation.
When a problem has no |Solution|, it is inherenty hard to come up with an explanation.
In the easiest case, a required package is missing from the |Database|.
In the most complex, many package dependencies are incompatible without a single culprit.
In this case, packages should be rebuild with weaker requirements, or with more build variants.
In this case, packages should be rebuilt with weaker requirements, or with more build variants.
The |UnSolvable| class attempts to build an explanation.

The :cpp:func:`UnSolvable.problems <mamba::solver::libsolv::UnSolvable::problems>` is a list
Expand Down
36 changes: 18 additions & 18 deletions docs/source/usage/specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Describing Conda Objects
.. |MatchSpec| replace:: :cpp:type:`MatchSpec <mamba::specs::MatchSpec>`


The :any:`libmambapy.specs <mamba::specs>` submodule contains object to *describe* abstraction in the Conda ecosystem.
The :any:`libmambapy.specs <mamba::specs>` submodule contains objects to *describe* abstraction in the Conda ecosystem.
They are purely functional and do not have any observable impact on the user system.
For instance |Channel| is used to describe a channel but does not download any file.

Expand All @@ -22,7 +22,7 @@ CondaURL
The |CondaURL| is a rich URL object that has additional capabilities for dealing with tokens,
platforms, and packages.

To parse a string into a |CondaURL| use :cpp:func:`CondaURL.parse <mamba::specs::CondaURL::parse>`
To parse a string into a |CondaURL|, use :cpp:func:`CondaURL.parse <mamba::specs::CondaURL::parse>`
as follows:

.. code:: python
Expand All @@ -42,7 +42,7 @@ For instance, here the character ``!`` in the file name ``x264-1!164.3095-h166bd
to be replaced with ``%21``.
The getter functions, such as :cpp:func:`CondaURL.package <mamba::specs::CondaURL::package>`
automatically decoded it for us, but we can specify ``decode=False`` to keep the raw representation.
The setters follow the same logic, as described bellow.
The setters follow the same logic, as described below.

.. code:: python
Expand Down Expand Up @@ -180,7 +180,7 @@ There are no hard-coded names:
You may have noticed that :cpp:func:`Channel.resolve <mamba::specs::Channel::resolve>` returns
multiple channels.
This is because of custom multichannel, a single name can return multiple channels.
This is because of custom multichannels, a single name can return multiple channels.


.. code:: python
Expand Down Expand Up @@ -299,7 +299,7 @@ We have the following primitives:
all but the last parts specified, including zeros.
For instance ``~=2.0`` matches ``2.0.0``, ``2.1.3``, but not ``3.0.1`` or ``2.0.0alpha``.

All version spec can be combine using a boolean grammar where ``|`` means **or** and ``,`` means
All version specs can be combined using a boolean grammar where ``|`` means **or** and ``,`` means
**and**.
For instance, ``(>2.1.0,<3.0)|==2.0.1`` means:

Expand Down Expand Up @@ -336,7 +336,7 @@ BuildNumberSpec
Similarly, a build number spec is a way to describe a set of build numbers.
It's much simpler than the |VersionSpec| in that it does not contain any boolean grammar
(the ``,`` and ``|`` operators).
|BuildNumberSpec| only contain primitives similar to that used in |VersionSpec|:
|BuildNumberSpec| only contain primitives similar to those used in |VersionSpec|:

- ``*`` or ``=*`` matches all build numbers (unrestricted).
- ``=`` for **equal** matches build numbers equal to the given one (a singleton).
Expand Down Expand Up @@ -387,10 +387,10 @@ Match specs have a complex string representation, which we can informally write
with an example
``conda-forge:ns:python>=3.7=*cypthon[subdir="linux-64",fn=pkg.conda]``.

- ``<channel>``, here ``conda-forge`` describes an |UnresolvedChannel| of where the channel the
package should come from.
- ``<channel>``, here ``conda-forge``, describes an |UnresolvedChannel| where the package
should come from.
It accepts all values from an unresolved channel, such as ``conda-forge/label/micromamba_dev``,
URLs, local file path, and platforms filters in between brackets.
URL, local file path, and platforms filters in between brackets.
- ``<namespace>``, here ``ns`` is a future, not implemented, feature.
It is nonetheless parsed, and retrievable.
- ``<name>``, here ``python`` is the package name or glob expression and is the only mandatory
Expand All @@ -400,8 +400,8 @@ with an example
followed by a ``<build_string>`` glob specification, here ``*cpython``.
- Last, a bracket section of comma separated ``<attribute>`` = ``<value>``.
In the example, we have two attributes, ``subdir`` and ``fn``.
Attribute values support quaoting with ``"`` or ``'``.
As such, they can be useful to set previously mentioned field without ambiguity.
Attribute values support quoting with ``"`` or ``'``.
As such, they can be useful to set previously mentioned fields without ambiguity.
Valid attribute names are:

- ``channel``, similar to ``<channel>``.
Expand All @@ -410,7 +410,7 @@ with an example
parentheses and ``,`` and ``|`` operators).
- ``build``, similar to ``<build_string>``.
- ``build_number`` to set the |BuildNumberSpec|.
- ``subdir`` to select the channel subdirectory platform from which the package must come from.
- ``subdir`` to select the channel subdirectory platform from which the package must come.
- ``fn`` to select the filename the package must match.
- ``md5`` to specify the MD5 hash the package archive must have.
- ``sha256`` to specify the SHA256 hash the package archive must have.
Expand All @@ -420,7 +420,7 @@ with an example

.. warning::

Specifying some value multiple time, such as in ``python>=3.7[version="(=3.9|>3.11)"]``, or
Specifying some value multiple times, such as in ``python>=3.7[version="(=3.9|>3.11)"]``, or
``python[build="foo"][build="bar"]`` is undefined and subject to change in the future.

.. warning::
Expand All @@ -435,13 +435,13 @@ with an example
The method
:cpp:func:`MatchSpec.contains_except_channel <mamba::specs::MatchSpec::contains_except_channel>`
can be used to check if a package is contained (matched) by the current |MatchSpec|.
The somewhat verbose name serve to indicate that the channel is ignored in this function.
As mentioned in the :ref:`Channel section<libmamba_usage_channel>` resolving and matching channels
The somewhat verbose name serves to indicate that the channel is ignored in this function.
As mentioned in the :ref:`Channel section<libmamba_usage_channel>`, resolving and matching channels
is a delicate operation.
In addition, the channel is a part that describe the **provenance** of a package and not is content
so various application ay want to handle it in different ways.
In addition, the channel is a part that describes the **provenance** of a package and not its content,
so various applications may want to handle it in different ways.
The :cpp:func:`MatchSpec.channel <mamba::specs::MatchSpec::channel>` attribute can be used to
reason about the possible channel contained in the |MatchSpec|.
reason about the possible channels contained in the |MatchSpec|.

.. code:: python
Expand Down

0 comments on commit 4d6eeef

Please sign in to comment.