Skip to content

Commit

Permalink
🌻
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Dec 22, 2023
1 parent 2199633 commit 3df2ea7
Show file tree
Hide file tree
Showing 8 changed files with 9,127 additions and 7 deletions.
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ uuid = "55704126-756f-498a-a54f-434b72ecbddd"
authors = ["Nathanael Bosch <[email protected]> and contributors"]
version = "1.0.0-DEV"

[deps]
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"

[compat]
julia = "1.6"

Expand Down
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# Dysts
# Dysts.jl: A Julia Port of [`dysts`](https://github.com/williamgilpin/dysts)

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://nathanaelbosch.github.io/Dysts.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://nathanaelbosch.github.io/Dysts.jl/dev/)
[![Build Status](https://github.com/nathanaelbosch/Dysts.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/nathanaelbosch/Dysts.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/nathanaelbosch/Dysts.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/nathanaelbosch/Dysts.jl)

## Overview

Dysts.jl is a Julia port of the "dysts" package originally developed by William Gilpin. The original code is publicly available under the Apache-2.0 license, and we extend our gratitude to William for his contribution to the project. This port was made possible by leveraging the power of GitHub Copilot for code generation, as well as incorporating helpful Emacs/Vim macros.

## Acknowledgments

- William Gilpin: The original author of the "dysts" package. We stand on the shoulders of his work, and much credit goes to him for creating the foundation.
- GitHub Copilot: The AI-powered coding assistant that played a significant role in accelerating the porting process. It's an invaluable tool for collaborative and efficient code development.
- Emacs/Vim Macros: Shoutout to the classic text editors and their macros that facilitated the coding experience, making repetitive tasks more manageable.

## Package Description

Dysts.jl is a collection of strange attractors implemented as functions returning ODEProblems. These ODE problems are fully compatible with the DifferentialEquations.jl ecosystem. Unlike the original "dysts" package, this port focuses solely on creating the ODEs and does not provide tools for discrete solution methods.

## Features
- Chaotic ODEs: Explore a variety of chaotic systems represented as ODEs.
- DifferentialEquations.jl Compatibility: Easily integrate these chaotic systems into the DifferentialEquations.jl ecosystem for seamless exploration and analysis.

## Installation

```julia

import Pkg
Pkg.add("Dysts")
```

## Usage

```julia
using Dysts, DifferentialEquations, Plots

prob = Dysts.Lorenz
sol = solve(prob, Tsit5())
plot(sol, vars=(1,2,3))
```

For more details and available attractors, refer to the original [`dysts`](https://github.com/williamgilpin/dysts) package.

## Contributing

Feel free to contribute by opening issues, suggesting improvements, or creating pull requests. Your feedback and participation are highly encouraged!

## License

Dysts.jl is licensed under the Apache-2.0 License.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Dysts = "55704126-756f-498a-a54f-434b72ecbddd"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ makedocs(;
canonical="https://nathanaelbosch.github.io/Dysts.jl",
edit_link="main",
assets=String[],
size_threshold_ignore = ["index.md"],
),
pages=[
"Home" => "index.md",
Expand Down
9 changes: 4 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
CurrentModule = Dysts
```

# Dysts
# Dysts.jl

Documentation for [Dysts](https://github.com/nathanaelbosch/Dysts.jl).

```@index
```
Full list of all dynamical systems:

```@autodocs
Modules = [Dysts]
Public = false
Pages = ["chaotic_attractors.jl"]
```
79 changes: 78 additions & 1 deletion src/Dysts.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
module Dysts

# Write your package code here.
using JSON, Markdown
using LinearAlgebra
using SciMLBase
using ComponentArrays


function dict_with_string_keys_to_symbol_keys(d::Dict)
new_d = Dict()
for (k, v) in d
new_d[Symbol(k)] = v
end
return new_d
end

function dict_to_componentarray(d::Dict)
return ComponentArray(dict_with_string_keys_to_symbol_keys(d))
end


function make_docstring(f)
data = ATTRACTOR_DATA[string(f)]
header = """
$f()
$(data["description"])
"""

stats = """
## Stats
"""
"correlation_dimenension" in keys(data) && (stats *= """
- Correlation dimension: $(data["correlation_dimension"])
""")
"embedding_dimension" in keys(data) && (stats *= """
- Embedding dimension: $(data["embedding_dimension"])
""")
"hamiltonian" in keys(data) && (stats *= """
- Hamiltonian: $(data["hamiltonian"])
""")
"kaplan_yorke_dimension" in keys(data) && (stats *= """
- Kaplan-Yorke dimension: $(data["kaplan_yorke_dimension"])
""")
"lyapunov_spectrum_estimated" in keys(data) && (stats *= """
- Lyapunov spectrum (estimated): $(data["lyapunov_spectrum_estimated"])
""")
"maximum_lyapunov_estimated" in keys(data) && (stats *= """
- Maximum Lyapunov exponent (estimated): $(data["maximum_lyapunov_estimated"])
""")
"multiscale_entropy" in keys(data) && (stats *= """
- Multiscale Entropy: $(data["multiscale_entropy"])
""")
"nonautonomous" in keys(data) && (stats *= """
- Non-autonomous: $(data["nonautonomous"])
""")
"period" in keys(data) && (stats *= """
- Period: $(data["period"])
""")
"pesin_entropy" in keys(data) && (stats *= """
- Pesin entropy: $(data["pesin_entropy"])
""")

citation = """
## Citation
$(data["citation"])
"""

code_string = """
## Original Python Code from the `dysts` package
```python
""" * originalcode(f) * """
```
"""

return header * stats * citation * code_string
end

include("chaotic_attractors.jl")

end
Loading

0 comments on commit 3df2ea7

Please sign in to comment.