`demo.ipynb` updated (#224)

* doc : generate mode section added to notebook

* doc : notebook updated

* fix : version_check script updated

* fix : info emoji updated

* doc : CHANGELOG.md updated

* doc : RELEASE.md updated

* doc : minor edit in demo.ipynb

* doc : minor edits in demo.ipynb

* doc : missed sign added to demo.ipynb

* doc : minor edit in demo.ipynb
pull/232/head
Sepand Haghighi 2024-09-01 22:58:06 +03:30 zatwierdzone przez GitHub
rodzic 23b14c7318
commit 4eb111a576
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 124 dodań i 31 usunięć

Wyświetl plik

@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- `mode` parameter added to `generate` method
- `README.md` updated
- `demo.ipynb` updated
## [1.2] - 2024-06-25
### Added
- `feature_request.yml` template

Wyświetl plik

@ -7,6 +7,14 @@
"# Samila Demo"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Version : 1.2\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": null,
@ -30,15 +38,15 @@
"import matplotlib.pyplot as plt\n",
"import random\n",
"import math\n",
"from samila import GenerativeImage, Projection, Marker"
"from samila import GenerativeImage, Projection, Marker, GenerateMode"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Basic Generation\n",
"If we call `generate` with no input parameters, we get a plot from two random equations"
"## Magic\n",
"If we call `generate` with no input parameters, we get a plot from two random equations."
]
},
{
@ -58,7 +66,7 @@
"metadata": {},
"source": [
"## Assigning Functions\n",
"By defining `f1` and `f2`, we can control the general shape of the plot"
"By defining `f1` and `f2`, we can control the general shape of the plot."
]
},
{
@ -85,10 +93,56 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Projection\n",
"We can use the `projection` attribute to define the coordinate system to transform our functions\n",
"## Generation Mode"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We have the option to select from various generation modes.\n",
"\n",
"The avaliable projections are `RECTILINEAR`, `POLAR`, `AITOFF`, `HAMMER`, `LAMBERT`, `MOLLWEIDE` and `RANDOM`"
" The avaliable modes are `F1_VS_F2`, `F2_VS_F1`, `F1_VS_INDEX`, `F2_VS_INDEX`, `INDEX_VS_F1`, `INDEX_VS_F2`, `F1_VS_X1`, `F1_VS_X2`, `F2_VS_X1`, `F2_VS_X2`, `X1_VS_F1`, `X1_VS_F2`, `X2_VS_F1` and `X2_VS_F2`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default mode is `F1_VS_F2`"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"g2 = GenerativeImage(f1, f2)\n",
"\n",
"for mode in list(GenerateMode):\n",
" print(mode)\n",
" g2.generate(mode=mode)\n",
" g2.plot()\n",
" plt.show()\n",
" plt.close()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Projection\n",
"We can use the `projection` attribute to define the coordinate system to transform our functions.\n",
"\n",
" The avaliable projections are `RECTILINEAR`, `POLAR`, `AITOFF`, `HAMMER`, `LAMBERT`, `MOLLWEIDE` and `RANDOM`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default projection is `RECTILINEAR`"
]
},
{
@ -100,9 +154,9 @@
"g2 = GenerativeImage(f1, f2)\n",
"g2.generate()\n",
"\n",
"for p in list(Projection):\n",
" print(p)\n",
" g2.plot(projection=p)\n",
"for projection in list(Projection):\n",
" print(projection)\n",
" g2.plot(projection=projection)\n",
" plt.show()\n",
" plt.close()"
]
@ -114,7 +168,14 @@
"## Marker\n",
"We can use the `marker` attribute to change the plotting marker.\n",
"\n",
"The available markers are `POINT`, `PIXEL`, `CIRCLE`, `TRIANGLE_DOWN`, `TRIANGLE_UP`, `TRIANGLE_LEFT`, `TRIANGLE_RIGHT`, `TRI_DOWN`, `TRI_UP`, `TRI_LEFT`, `TRI_RIGHT`, `OCTAGON`, `SQUARE`, `PENTAGON`, `PLUS`, `PLUS_FILLED`, `STAR`, `HEXAGON_VERTICAL`, `HEXAGON_HORIZONTAL`, `X`, `X_FILLED`, `DIAMOND`, `DIAMON_THIN`, `VLINE`, `HLINE` and `RANDOM`."
" The available markers are `POINT`, `PIXEL`, `CIRCLE`, `TRIANGLE_DOWN`, `TRIANGLE_UP`, `TRIANGLE_LEFT`, `TRIANGLE_RIGHT`, `TRI_DOWN`, `TRI_UP`, `TRI_LEFT`, `TRI_RIGHT`, `OCTAGON`, `SQUARE`, `PENTAGON`, `PLUS`, `PLUS_FILLED`, `STAR`, `HEXAGON_VERTICAL`, `HEXAGON_HORIZONTAL`, `X`, `X_FILLED`, `DIAMOND`, `DIAMON_THIN`, `VLINE`, `HLINE` and `RANDOM`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default marker is `POINT`"
]
},
{
@ -137,10 +198,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Rotation\n",
"## Rotation\n",
"You can even rotate your art by using `rotation` parameter. Enter your desired rotation for the image in degrees and you will have it.\n",
"\n",
"* Default rotation is 0."
" Default rotation is `0`"
]
},
{
@ -160,7 +221,14 @@
"source": [
"## Range\n",
"\n",
"Control the range over which the input values span"
"Control the range over which the input values span."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default range is $(-\\pi, \\pi)$"
]
},
{
@ -181,7 +249,16 @@
"source": [
"## Color\n",
"\n",
"We can assign colors for both the background as well as the line\n"
"We can assign colors for both the background as well as the line.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default color is `black`\n",
"\n",
" Default background-color is `white`"
]
},
{
@ -200,8 +277,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"* Supported colors are available in `VALID_COLORS` list\n",
"* `color` and `bgcolor` parameters supported formats:\n",
" Supported colors are available in `VALID_COLORS` list\n",
"\n",
" `color` and `bgcolor` parameters supported formats:\n",
"\n",
" 1. Color name (example: `color=\"yellow\"`)\n",
" 2. RGB/RGBA (example: `color=(0.1,0.1,0.1)`, `color=(0.1,0.1,0.1,0.1)`)\n",
@ -224,7 +302,7 @@
"source": [
"### Point Color\n",
"\n",
"You can make your custom color map and use it in Samila"
"You can make your custom color map and use it in Samila."
]
},
{
@ -251,7 +329,14 @@
"source": [
"## Spot Size\n",
"\n",
"We can also change the size of the plot marker"
"We can also change the size of the plot marker."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" Default spot-size is `0.01`"
]
},
{
@ -271,9 +356,9 @@
"metadata": {},
"source": [
"## Random Seeds\n",
"If we do not pass in a seed when calling `generate`, a random seed will be created for us\n",
"If we do not pass in a seed when calling `generate`, a random seed will be created for us.\n",
"\n",
"Passing this seed into `generate` will guarantee plot reproducibility"
"Passing this seed into `generate` will guarantee plot reproducibility."
]
},
{
@ -304,9 +389,9 @@
"source": [
"## Saving Images\n",
"\n",
"Save generated images\n",
"Save generated images.\n",
"\n",
"Use the `depth` attribute to increase the resolution"
"Use the `depth` attribute to increase the resolution."
]
},
{
@ -333,9 +418,9 @@
"source": [
"## Saving Data\n",
"\n",
"Save generated image data\n",
"Save generated image data.\n",
"\n",
"It can then be loaded into a `GenerativeImage` instance"
"It can then be loaded into a `GenerativeImage` instance."
]
},
{
@ -363,9 +448,9 @@
"source": [
"## Saving Config\n",
"\n",
"Save generated image config. It contains string formats of functions which is also human readable\n",
"Save generated image config. It contains string formats of functions which is also human readable.\n",
"\n",
"It can then be loaded into a `GenerativeImage` instance"
"It can then be loaded into a `GenerativeImage` instance."
]
},
{
@ -399,7 +484,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Upload generated image directly to [NFT.storage](https://nft.storage)"
"Upload generated image directly to [NFT.storage](https://nft.storage)."
]
},
{
@ -449,7 +534,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"* Default timeout is **3000** seconds"
"⚠️ This method is deprecated and may be removed in future releases\n",
"\n",
" Default timeout is `3000` seconds\n",
"\n",
" Default gateway is `IPFS_IO`"
]
}
],
@ -487,7 +576,7 @@
"width": "256px"
},
"toc_section_display": false,
"toc_window_display": true
"toc_window_display": false
},
"vscode": {
"interpreter": {

Wyświetl plik

@ -1,6 +1,6 @@
# Samila Release Instructions
**Last Update: 2024-06-06**
**Last Update: 2024-08-30**
1. Create the `release` branch under `dev`
2. Update all version tags
@ -10,6 +10,7 @@
4. `otherfiles/version_check.py`
5. `otherfiles/meta.yaml`
6. `samila/params.py`
7. `examples/demo.ipynb`
3. Update `CHANGELOG.md`
1. Add a new header under `Unreleased` section (Example: `## [0.1] - 2022-08-17`)
2. Add a new compare link to the end of the file (Example: `[0.2]: https://github.com/sepandhaghighi/samila/compare/v0.1...v0.2`)

Wyświetl plik

@ -22,6 +22,7 @@ PARAMS_ITEMS = ['SAMILA_VERSION = "{0}"']
META_ITEMS = ['% set version = "{0}" %']
ISSUE_TEMPLATE_ITEMS = ["- Samila {0}"]
SECURITY_ITEMS = ["| {0} | :white_check_mark: |", "| < {0} | :x: |"]
DEMO_ITEMS = ["### Version : {0}"]
FILES = {
"setup.py": SETUP_ITEMS,
@ -34,6 +35,7 @@ FILES = {
".github",
"ISSUE_TEMPLATE",
"bug_report.yml"): ISSUE_TEMPLATE_ITEMS,
os.path.join("examples", "demo.ipynb"): DEMO_ITEMS
}
TEST_NUMBER = len(FILES)