Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
VascoSch92 committed May 13, 2024
1 parent 276581c commit eea21a0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 37 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MAINTENANCE:
- `.github.pull_request_template.md`: add pull request template
- `.github.ISSUE_TEMPLATE`: add templates for issues
- `tests`: in module tests we import as in the API
- `.pre-commit-config.yml`: add `check-toml` and `name-tests-test`

## \[0.0.0\] - 2024-05-01

Expand Down
41 changes: 21 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@

If you would like to contribute to the project, please take a moment to read the following points.

1. Checks if there is an [issue](https://github.com/VascoSch92/symmetria/issues) where the contribution
you had in mind is already discussed.
1. Checks if there is an [issue](https://github.com/VascoSch92/symmetria/issues) where the contribution
you had in mind is already discussed.
If it is not the case, open a new [issue](https://github.com/VascoSch92/symmetria/issues).
you would like to contribute but are unsure what to work on, take a look at the
[issue](https://github.com/VascoSch92/symmetria/issues) section.
There are plenty of ideas we would like to implement here.
2. Time to code. Once you have finished coding your implementation, open a pull-request (PR) to the ``main`` branch.
you would like to contribute but are unsure what to work on, take a look at the
[issue](https://github.com/VascoSch92/symmetria/issues) section.
There are plenty of ideas we would like to implement here.

1. Time to code. Once you have finished coding your implementation, open a pull-request (PR) to the `main` branch.
Note that the PR title should start with one of the following (included parentheses):

1. [API_CHANGE]: If there is a change to the project's API.
2. [DEPRECATED]: If the PR deprecate some functionalities.
3. [DOC]: If the PR improves the documentation.
4. [ENHANCEMENT]: if the PR improve and existing functionality.
5. [FEATURE]: if the PR add a new feature.
6. [FIX]: If the PR solve issues, bugs, or unexpected behavior.
7. [MAINTENANCE]: If the PR has to do with CI/CD or setup.
8. [RELEASE]: If the PR is a preparation for a release.
- \[API_CHANGE\]: If there is a change to the project's API.
- \[DEPRECATED\]: If the PR deprecate some functionalities.
- \[DOC\]: If the PR improves the documentation.
- \[ENHANCEMENT\]: if the PR improve and existing functionality.
- \[FEATURE\]: if the PR add a new feature.
- \[FIX\]: If the PR solve issues, bugs, or unexpected behavior.
- \[MAINTENANCE\]: If the PR has to do with CI/CD or setup.
- \[RELEASE\]: If the PR is a preparation for a release.

An example is

```text
[FEATURE] Add method AAA to class BBB
```
3. However, before opening a PR, it is a good practice to have pre-commit installed.
To use the pre-commit hook, you first need to install ``pre-commit`` using the command:

1. However, before opening a PR, it is a good practice to have pre-commit installed.
To use the pre-commit hook, you first need to install `pre-commit` using the command:

```bash
pip install pre-commit
Expand All @@ -40,13 +41,13 @@ If you would like to contribute to the project, please take a moment to read the
pre-commit install
```

You can also run the pre-commit locally by running the following command
You can also run the pre-commit locally by running the following command
from the project's working directory:

```bash
pre-commit run --all-files
```

4. Now your PR is ready for review!
1. Now your PR is ready for review!

Thanks for your contribution ❤️
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Welcome to symmetria

---
______________________________________________________________________

Symmetria provides an intuitive, thorough, and comprehensive framework for interacting
Symmetria provides an intuitive, thorough, and comprehensive framework for interacting
with the symmetric group and its elements.

- 📦 - installable via pip
Expand All @@ -12,14 +12,13 @@ with the symmetric group and its elements.
- ✅ - 100% of test coverage

You can give a look at how to work with symmetria in the section [quickstart](#quickstart),
or you can check (almost) all the functionality implemented
or you can check (almost) all the functionality implemented
[here](#list-of-implemented-functionality).

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change, and give a look to the
to discuss what you would like to change, and give a look to the
[contribution guidelines](https://github.com/VascoSch92/symmetria/blob/main/CONTRIBUTING.md).


## Installation

Symmetria can be comfortably installed from PyPI using the command
Expand All @@ -34,7 +33,7 @@ or directly from the source GitHub code with
pip install git+https://github.com/VascoSch92/symmetria@xxx
```

where ``xxx`` is the name of the branch or the tag you would like to install.
where `xxx` is the name of the branch or the tag you would like to install.

You can check that `symmetria` was successfully installed by typing the command

Expand All @@ -44,11 +43,11 @@ symmetria --version

## Quickstart

Let's get started with symmetria. First and foremost, we can import the `Permutation`
class from `symmetria`. The Permutation class serves as the fundamental class for
working with elements of the symmetric group, representing permutations as
bijective maps. Additionally, you can utilize the `Cycle` class and `CycleDecomposition`
class to work with cycle permutations and permutations represented as cycle
Let's get started with symmetria. First and foremost, we can import the `Permutation`
class from `symmetria`. The Permutation class serves as the fundamental class for
working with elements of the symmetric group, representing permutations as
bijective maps. Additionally, you can utilize the `Cycle` class and `CycleDecomposition`
class to work with cycle permutations and permutations represented as cycle
decompositions, respectively.

```python
Expand Down Expand Up @@ -76,15 +75,16 @@ if len(permutation) == 6:
print("The permutation acts on 6 elements.")
print(permutation * permutation)
```
Furthermore, we can decompose a permutation into its cycle decomposition

Furthermore, we can decompose a permutation into its cycle decomposition
(`CycleDecomposition`) and compute its order and support.

```python
permuttation.cycle_decomposition()
permuttation.cycle_decomposition()
# returns CycleDecomposition(Cycle(1), Cycle(2, 3, 4, 5), Cycle(6))
permutation.order() # 4
permutation.support() # {2, 3, 4, 5}
permutation.is_derangement() # True
permutation.order() # 4
permutation.support() # {2, 3, 4, 5}
permutation.is_derangement() # True
```

## List of implemented functionality
Expand All @@ -93,7 +93,7 @@ A list of (some) of the functionality implemented for the various classes repres
Here, `P` is for `Permutation`, `C`for `Cycle`, and `CD` for `CycleDecomposition`.

| Feature | Description | P | C | CD |
|-----------------------|---------------------------------------------------------|-----|-----|-----|
| --------------------- | ------------------------------------------------------- | --- | --- | --- |
| `__call__` | Call a permutation on an object ||||
| `__mul__` | Multiplication (composition) between permutations ||||
| `cycle_decomposition` | Cycle decomposition of the permutation ||||
Expand Down

0 comments on commit eea21a0

Please sign in to comment.