Skip to content

Commit

Permalink
Merge pull request #105 from sepandhaghighi/dev
Browse files Browse the repository at this point in the history
Version 0.5
  • Loading branch information
sepandhaghighi authored Mar 21, 2022
2 parents 0949c8c + 301e36b commit 7c39ac3
Show file tree
Hide file tree
Showing 15 changed files with 530 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
python -m bandit -r samila -s B311,B307
python -m pydocstyle -v --match-dir=samila
if: matrix.python-version == 3.7
- name: Notebook check
run: |
pip install notebook>=5.2.2
python otherfiles/notebook_check.py
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
- name: Codecov
run: |
codecov
Expand Down
7 changes: 4 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Core Developer #

----------
- Sepand Haghighi - Sharif University Of Technology/Moduland Co - [@sepandhaghighi](http://github.com/sepandhaghighi)
- Sadra Sabouri - Sharif University Of Technology - [@sadrasabouri](https://github.com/sadrasabouri)
- Sepand Haghighi - Sharif University of Technology - [@sepandhaghighi](http://github.com/sepandhaghighi)
- Sadra Sabouri - Sharif University of Technology - [@sadrasabouri](https://github.com/sadrasabouri)

# Other Contributors #
- Mohammad Hosein Moslemi - Sharif University Of Technology - [@mhmoslemi2338](https://github.com/mhmoslemi2338)
- Mohammad Hosein Moslemi - [@mhmoslemi2338](https://github.com/mhmoslemi2338)
- Evan Slack - [@evanofslack](https://github.com/evanofslack)
----------
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.5] - 2022-03-21
### Added
- `__del__` method
- Demo notebook
### Changed
- `depth` parameter added to `nft_storage` method
- `depth` parameter added to `save_fig_buf` function
- `alpha` parameter added to `plot` method
- `alpha` parameter added to `plot_params_filter` function
- Random mode modified
- `README.md` updated
## [0.4] - 2022-01-13
### Added
- `PLOT_DATA_ERROR` error message
Expand Down Expand Up @@ -70,7 +81,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `generate` method
- `nft_storage` method

[Unreleased]: https://github.com/sepandhaghighi/samila/compare/v0.4...dev
[Unreleased]: https://github.com/sepandhaghighi/samila/compare/v0.5...dev
[0.5]: https://github.com/sepandhaghighi/samila/compare/v0.4...v0.5
[0.4]: https://github.com/sepandhaghighi/samila/compare/v0.3...v0.4
[0.3]: https://github.com/sepandhaghighi/samila/compare/v0.2...v0.3
[0.2]: https://github.com/sepandhaghighi/samila/compare/v0.1...v0.2
Expand Down
82 changes: 77 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<img src="https://codecov.io/gh/sepandhaghighi/samila/branch/master/graph/badge.svg" />
</a>
<a href="https://badge.fury.io/py/samila"><img src="https://badge.fury.io/py/samila.svg" alt="PyPI version" height="18"></a>
<a href="https://colab.research.google.com/github/sepandhaghighi/samila/blob/master">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Samila-Colab"/>
</a>
<a href="https://discord.com/invite/94bz5QGZWb">
<img src="https://img.shields.io/discord/900055829225562162.svg" alt="Discord Channel">
</a>
Expand All @@ -19,8 +22,10 @@
* [Installation](https://github.com/sepandhaghighi/samila#installation)
* [Usage](https://github.com/sepandhaghighi/samila#usage)
* [Mathematical Details](https://github.com/sepandhaghighi/samila#mathematical-details)
* [Try Samila in Your Browser](https://github.com/sepandhaghighi/samila#try-samila-in-your-browser)
* [Issues & Bug Reports](https://github.com/sepandhaghighi/samila#issues--bug-reports)
* [Dependencies](https://github.com/sepandhaghighi/samila#dependencies)
* [Social Media](https://github.com/sepandhaghighi/samila#social-media)
* [Contribution](https://github.com/sepandhaghighi/samila/blob/master/.github/CONTRIBUTING.md)
* [References](https://github.com/sepandhaghighi/samila#references)
* [Authors](https://github.com/sepandhaghighi/samila/blob/master/AUTHORS.md)
Expand Down Expand Up @@ -82,15 +87,15 @@ Samila is a generative art generator written in Python, Samila let's you create


### Source code
- Download [Version 0.4](https://github.com/sepandhaghighi/samila/archive/v0.4.zip) or [Latest Source ](https://github.com/sepandhaghighi/samila/archive/dev.zip)
- Download [Version 0.5](https://github.com/sepandhaghighi/samila/archive/v0.5.zip) or [Latest Source ](https://github.com/sepandhaghighi/samila/archive/dev.zip)
- Run `pip install -r requirements.txt` or `pip3 install -r requirements.txt` (Need root access)
- Run `python3 setup.py install` or `python setup.py install` (Need root access)

### PyPI


- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- Run `pip install samila==0.4` or `pip3 install samila==0.4` (Need root access)
- Run `pip install samila==0.5` or `pip3 install samila==0.5` (Need root access)

### Easy install

Expand Down Expand Up @@ -182,7 +187,7 @@ Samila is a generative art generator written in Python, Samila let's you create
Upload generated image directly to [NFT.storage](https://NFT.storage)

```pycon
>>> g.nft_storage(api_key=YOUR_API_KEY)
>>> g.nft_storage(api_key="YOUR_API_KEY")
{'status': True, 'message': 'Everything seems good'}
```

Expand All @@ -204,12 +209,37 @@ Save generated image in higher resolutions
Save generated image data

```pycon
>>> g.save_data(file_adr="test.json")
>>> g.save_data(file_adr="data.json")
```
So you can load it into a `GenerativeImage` instance later by

```pycon
>>> g = GenerativeImage(data=open('test.json', 'r'))
>>> g = GenerativeImage(data=open('data.json', 'r'))
```

Data structure:
```JSON
{
"plot": {
"projection": "polar",
"bgcolor": "black",
"color": "snow",
"spot_size": 0.01
},
"matplotlib_version": "3.0.3",
"data1": [
0.3886741692042526,
22.57390286376703,
-0.1646310981668766,
66.23632344600155
],
"data2": [
-0.14588750183600108,
20.197945942677833,
0.5485453260942901,
-589.3284610518896
]
}
```

### Save config
Expand All @@ -224,6 +254,28 @@ So you can load it into a `GenerativeImage` instance later by
>>> g = GenerativeImage(config=open('config.json', 'r'))
```

Config structure:

```JSON
{
"matplotlib_version": "3.0.3",
"generate": {
"seed": 379184,
"stop": 3.141592653589793,
"step": 0.01,
"start": -3.141592653589793
},
"f2": "random.uniform(-1,1)*math.cos(x*(y**3))+random.uniform(-1,1)*math.ceil(y-x)",
"f1": "random.uniform(-1,1)*math.ceil(y)-random.uniform(-1,1)*y**2+random.uniform(-1,1)*abs(y-x)",
"plot": {
"color": "snow",
"bgcolor": "black",
"projection": "polar",
"spot_size": 0.01
}
}
```

## Mathematical details
Samila is simply a transformation between a square-shaped space from the Cartesian coordinate system to any arbitrary coordination like [Polar coordinate system](https://en.wikipedia.org/wiki/Polar_coordinate_system).

Expand Down Expand Up @@ -258,6 +310,15 @@ here we uses `Projection.POLAR` so later space will be the polar space and we ha

<img src="https://github.com/sepandhaghighi/samila/raw/master/otherfiles/images/6.png">

## Try Samila in your browser!
Samila can be used online in interactive Jupyter Notebooks via the Binder or Colab services! Try it out now! :

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sepandhaghighi/samila/master)

[![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/sepandhaghighi/samila/blob/master)

* Check `examples` folder

## Issues & bug reports

Just fill an issue and describe it. We'll check it ASAP!
Expand All @@ -284,6 +345,13 @@ You can also join our discord server
</tr>
</table>

## Social media

1. [Instagram](https://www.instagram.com/samila_arts)
2. [Telegram](https://t.me/samila_arts)
3. [Twitter](https://twitter.com/samila_arts)
4. [Discord](https://discord.com/invite/94bz5QGZWb)


## References

Expand Down Expand Up @@ -330,5 +398,9 @@ zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5
<a href="http://www.coffeete.ir/opensource">
<img src="http://www.coffeete.ir/images/buttons/lemonchiffon.png" style="width:260px;" />
</a>
<h4>Gitcoin</h4>
<a href="https://gitcoin.co/grants/3915/samila-generative-art-generator">
<img src="https://github.com/sepandhaghighi/samila/raw/master/otherfiles/gitcoin_btn.png" style="width:260px;" />
</a>


2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==3.5.1
art==5.4
art==5.5
vulture>=1.0
bandit>=1.5.1
pydocstyle>=3.0.0
Expand Down
Loading

0 comments on commit 7c39ac3

Please sign in to comment.