Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hukenovs committed Dec 11, 2021
1 parent 4688a8a commit 5427030
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: '^$'
fail_fast: false
default_language_version:
python: python3.6.9
python: python3.9
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
Expand Down
11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dependencies

Project requires:

- Python (>= 3.6)
- Python (>= 3.9)
- NumPy (>= 1.19.0)
- SciPy (>= 1.5.1)
- Pandas (>= 1.1.0)
Expand Down Expand Up @@ -68,8 +68,11 @@ Source code

You can check the latest sources with the command::

$ git clone https://github.com/capitanov/chaospy.git
$ git clone <chaospy.git>
$ cd chaospy
$ <install miniconda for your operation system>
$ conda create -y -n venv python==3.9
$ conda activate venv
$ pip install -r requirements.txt

Help
Expand Down Expand Up @@ -147,5 +150,5 @@ Chua circuit
See Also
~~~~~~~~

- `Wikipedia -> chaotic attractors. <https://en.wikipedia.org/wiki/Attractor>`__
- `My articles on habrahabr. (rus lang.) <https://habr.com/users/capitanov/topics/>`__
- `Wiki <https://en.wikipedia.org/wiki/Attractor>`__
- `Habr <https://habr.com/users/hukenovs>`__
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 80
line_length = 120

[tool.black]
line-length = 120
target-version = ['py36', 'py37', 'py38']
target-version = ['py39']
exclude = '''
/(
\.eggs
Expand Down
12 changes: 8 additions & 4 deletions src/attractors/attractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,14 @@ def __iter__(self):

def __next__(self):
points = self.init_point
for _ in range(self.num_points):
yield points
next_points = self.attractor(*points, **self.kwargs)
points = tuple(prev + curr / self.step for prev, curr in zip(points, next_points))
for i in range(self.num_points):
try:
yield points
next_points = self.attractor(*points, **self.kwargs)
points = tuple(prev + curr / self.step for prev, curr in zip(points, next_points))
except OverflowError:
print(f"[FAIL]: Cannot do the next step because of floating point overflow. Step: {i}")
break

@abstractmethod
def attractor(self, x: float, y: float, z: float, **kwargs) -> Tuple[float, float, float]:
Expand Down
18 changes: 10 additions & 8 deletions src/utils/drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ def coordinates(self, value: np.ndarray):
def min_max_axis(self):
return np.vstack([np.min(self.coordinates, axis=0), np.max(self.coordinates, axis=0)]).T

# TODO: Add plots for KDE
# # Plot Probability density function
# plt.figure("Probability density function")
# for ii in range(nn):
# plt.plot(d_kde[ii], ".")
# plt.xlim([0, n_pdf - 1])
# plt.grid()
# plt.tight_layout()
def plot_kde(self, kde: np.ndarray, pdf: np.ndarray):
"""Plot Probability density function"""
_ = plt.figure("Probability density function", figsize=(8, 6), dpi=100)
for ii, axis in enumerate(self._plot_labels.values()):
plt.subplot(3, 3, ii + 1)
plt.title("KDE plots", y=1.0) if ii % 2 == 1 else None
plt.plot(kde[ii], ".")
plt.xlim([0, pdf - 1])
plt.grid()
plt.tight_layout()

def show_spectrum_and_correlation(self, spectrums: np.ndarray, correlations: np.ndarray):
"""Plot 3D coordinates as time series."""
Expand Down

0 comments on commit 5427030

Please sign in to comment.