Skip to content

Commit

Permalink
Merge pull request #78 from fuzzylite/feature/improvements
Browse files Browse the repository at this point in the history
Version 8.0.3
  • Loading branch information
jcrada committed May 17, 2024
2 parents 0fc7c57 + c843f52 commit 7029711
Show file tree
Hide file tree
Showing 49 changed files with 615 additions and 1,036 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install requirements
run: pip install -r requirements.txt
run: pip install -r requirements-dev.txt

- name: Check
run: nox -e check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python-version: "3.9"

- name: Install requirements
run: pip install -r requirements.txt
run: pip install -r requirements-dev.txt

- name: Build
run: poetry build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install requirements
run: pip install -r requirements.txt
run: pip install -r requirements-dev.txt

- name: Check
run: nox -e check
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors:
- given-names: Juan
family-names: Rada-Vilela
email: [email protected]
affiliation: FuzzyLite Limited
affiliation: FuzzyLite
repository-code: 'https://github.com/fuzzylite/pyfuzzylite'
url: 'https://fuzzylite.com'
abstract: >-
Expand Down
6 changes: 6 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pyfuzzylite: a fuzzy logic control library in Python.

fuzzylite is a registered trademark of FuzzyLite.
pyfuzzylite, jfuzzylite and QtFuzzyLite are trademarks of FuzzyLite.

Copyright (C) 2010-2024 FuzzyLite by Juan Rada-Vilela. All rights reserved.
11 changes: 11 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Version 8.0.3

- Renamed `requirements.txt` to `requirements-dev.txt`
- Added `__author__`, `__copyright__` and `__license__` to `fuzzylite.__init__.py` and `fuzzylite.library.information`
- Removed `Limited` in `FuzzyLite Limited` everywhere, eg, `fuzzylite.information.company = "FuzzyLite"`
- `RuleBlock`: Added `RuleBlock.rule(int)` to get rule by index
- `Function`: Unary functions can be defined in either left or right nodes
- Upgraded dependencies: `nox`, `poetry`, `mypy`, `pyright`, `black`, `ruff`
- Improved tests
- Shortened preamble in every file

# Version 8.0.2

### Bug fixes
Expand Down
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# pyfuzzylite 8.0.2

<img src="https://fuzzylite.github.io/pyfuzzylite/image/fuzzylite.svg" align="left" alt="fuzzylite">

## A Fuzzy Logic Control Library in Python

by [**Juan Rada-Vilela, PhD**](https://fuzzylite.com/about)

<br>
<br>
<div align="center">
<img src="/fuzzylite.png" alt="fuzzylite" width="10%">
<h1>pyfuzzylite 8.0.3</h1>
<h2>A Fuzzy Logic Control Library in Python</h2>
<h3>by <a href="https://fuzzylite.com/about"><b>Juan Rada-Vilela, PhD</b></a></h3>

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://opensource.org/license/gpl-3-0/)
[![License: Paid](https://img.shields.io/badge/License-proprietary-blue)](mailto:[email protected])
[![Coverage Status](
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=main)](
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
[![Build](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)
[![Test](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml)
[![Publish](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml)

</div>

## <a name="fuzzylite">FuzzyLite</a>

**The FuzzyLite Libraries for Fuzzy Logic Control** refer to [`fuzzylite`](https://github.com/fuzzylite/fuzzylite/)
Expand Down Expand Up @@ -223,7 +220,5 @@ Or using `bibtex`:

***

fuzzylite&reg; is a registered trademark of FuzzyLite Limited <br>
jfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
pyfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
QtFuzzyLite&trade; is a trademark of FuzzyLite Limited <br>
fuzzylite&reg; is a registered trademark of FuzzyLite <br>
jfuzzylite&trade;, pyfuzzylite&trade; and QtFuzzyLite&trade; are trademarks of FuzzyLite
26 changes: 9 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
# pyfuzzylite 8.0.2

***

<img src="https://fuzzylite.github.io/pyfuzzylite/image/fuzzylite.svg" align="left" alt="fuzzylite">

## A Fuzzy Logic Control Library in Python

by [**Juan Rada-Vilela, PhD** :fontawesome-solid-square-arrow-up-right:](https://fuzzylite.com/about)

***
<div align="center">
<img src="/fuzzylite.png" alt="fuzzylite" width="10%">
<h1>pyfuzzylite 8.0.3</h1>
<h2>A Fuzzy Logic Control Library in Python</h2>
<h3>by <a href="https://fuzzylite.com/about"><b>Juan Rada-Vilela, PhD</b></a></h3>

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://opensource.org/license/gpl-3-0/)
[![License: Paid](https://img.shields.io/badge/License-proprietary-blue)](mailto:[email protected])
[![Coverage Status](
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=main)](
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
[![Build](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)
[![Test](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml)
[![Publish](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml/badge.svg)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml)

***
</div>

## <a name="fuzzylite">FuzzyLite</a>

Expand Down Expand Up @@ -221,7 +215,5 @@ Or using `bibtex`:

***

fuzzylite&reg; is a registered trademark of FuzzyLite Limited <br>
jfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
pyfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
QtFuzzyLite&trade; is a trademark of FuzzyLite Limited <br>
fuzzylite&reg; is a registered trademark of FuzzyLite <br>
jfuzzylite&trade;, pyfuzzylite&trade; and QtFuzzyLite&trade; are trademarks of FuzzyLite
21 changes: 9 additions & 12 deletions fuzzylite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""
from . import examples # noqa

from . import examples # noqa: F401
from .activation import *
from .benchmark import *
from .defuzzifier import *
Expand All @@ -35,3 +29,6 @@
__name__ = information.name
__doc__ = information.description
__version__ = information.version
__author__ = information.author
__copyright__ = information.copyright
__license__ = information.license
16 changes: 5 additions & 11 deletions fuzzylite/activation.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = [
Expand Down
15 changes: 4 additions & 11 deletions fuzzylite/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations
Expand Down
16 changes: 5 additions & 11 deletions fuzzylite/defuzzifier.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = [
Expand Down
16 changes: 5 additions & 11 deletions fuzzylite/engine.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = ["Engine"]
Expand Down
22 changes: 8 additions & 14 deletions fuzzylite/exporter.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = ["Exporter", "FllExporter", "PythonExporter", "FldExporter"]
Expand Down Expand Up @@ -386,11 +380,12 @@ def format(self, code: str, **kwargs: Any) -> str:
Returns:
code formatted if `black` is installed, otherwise the code without format
"""
kwargs = {"line_length": 100} | kwargs
try:
import black

return black.format_str(code, mode=black.Mode(**kwargs))
kwargs = dict(line_length=100) | kwargs
formatted = black.format_str(code, mode=black.Mode(**kwargs))
return formatted
except ModuleNotFoundError:
settings.logger.error("expected `black` module to be installed, but could not be found")
except ValueError: # black.parsing.InvalidInput
Expand All @@ -414,7 +409,6 @@ def encapsulate(self, instance: Any) -> str:
if isinstance(instance, Engine):
code += f"""\
class {Op.pascal_case(instance.name)}:
def __init__(self) -> None:
self.engine = {repr(instance)}
"""
Expand Down
16 changes: 5 additions & 11 deletions fuzzylite/factory.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = [
Expand Down
16 changes: 5 additions & 11 deletions fuzzylite/hedge.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
"""pyfuzzylite (TM), a fuzzy logic control library in Python.
Copyright (C) 2010-2023 FuzzyLite Limited. All rights reserved.
Author: Juan Rada-Vilela, PhD <[email protected]>.
"""pyfuzzylite: a fuzzy logic control library in Python.
This file is part of pyfuzzylite.
pyfuzzylite is free software: you can redistribute it and/or modify it under
the terms of the FuzzyLite License included with the software.
You should have received a copy of the FuzzyLite License along with
pyfuzzylite. If not, see <https://github.com/fuzzylite/pyfuzzylite/>.
Repository: https://github.com/fuzzylite/pyfuzzylite/
pyfuzzylite is a trademark of FuzzyLite Limited.
License: FuzzyLite License
fuzzylite is a registered trademark of FuzzyLite Limited.
Copyright: FuzzyLite by Juan Rada-Vilela. All rights reserved.
"""

from __future__ import annotations

__all__ = [
Expand Down
Loading

0 comments on commit 7029711

Please sign in to comment.