kopia lustrzana https://github.com/sepandhaghighi/samila
Minor edits (#98)
* fix : alpha added to save_config and save_data * fix : alpha added to load_config and load_data * doc : docstring updated * doc : CHANGELOG updated * fix : autopep8 * doc : AUTHORS.md updated * fix : overall_test.py updated * doc : AUTHORS.md updatedpull/102/head
rodzic
fed58e0ee3
commit
5d3a0a11bb
|
@ -1,10 +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)
|
||||
----------
|
|
@ -7,11 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
## [Unreleased]
|
||||
### Added
|
||||
- `__del__` method
|
||||
- `alpha` attribute
|
||||
- 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
|
||||
|
|
|
@ -164,7 +164,7 @@ def plot_params_filter(
|
|||
:type size: tuple
|
||||
:param projection: projection type
|
||||
:type projection: str
|
||||
:param alpha: point alpha
|
||||
:param alpha: point transparency
|
||||
:type alpha: float
|
||||
:return: None
|
||||
"""
|
||||
|
@ -308,7 +308,8 @@ def save_data_file(g, file_adr):
|
|||
"color": g.color,
|
||||
"bgcolor": g.bgcolor,
|
||||
"spot_size": g.spot_size,
|
||||
"projection": g.projection
|
||||
"projection": g.projection,
|
||||
"alpha": g.alpha
|
||||
}
|
||||
data['matplotlib_version'] = matplotlib_version
|
||||
result = {"status": True, "message": DATA_SAVE_SUCCESS_MESSAGE}
|
||||
|
@ -347,7 +348,8 @@ def save_config_file(g, file_adr):
|
|||
"color": g.color,
|
||||
"bgcolor": g.bgcolor,
|
||||
"spot_size": g.spot_size,
|
||||
"projection": g.projection
|
||||
"projection": g.projection,
|
||||
"alpha": g.alpha
|
||||
}
|
||||
data['matplotlib_version'] = matplotlib_version
|
||||
result = {"status": True, "message": DATA_SAVE_SUCCESS_MESSAGE}
|
||||
|
@ -378,7 +380,7 @@ def save_fig_file(figure, file_adr, depth):
|
|||
try:
|
||||
figure.savefig(
|
||||
file_adr,
|
||||
dpi=depth*figure.dpi,
|
||||
dpi=depth * figure.dpi,
|
||||
facecolor=figure.get_facecolor(),
|
||||
edgecolor='none')
|
||||
return result
|
||||
|
@ -408,7 +410,7 @@ def save_fig_buf(figure, depth):
|
|||
buf = io.BytesIO()
|
||||
figure.savefig(
|
||||
buf,
|
||||
dpi=depth*figure.dpi,
|
||||
dpi=depth * figure.dpi,
|
||||
format='png',
|
||||
facecolor=figure.get_facecolor(),
|
||||
edgecolor='none')
|
||||
|
@ -468,6 +470,7 @@ def load_data(g, data):
|
|||
g.bgcolor = plot_config.get("bgcolor", DEFAULT_BACKGROUND_COLOR)
|
||||
g.spot_size = plot_config.get("spot_size", DEFAULT_SPOT_SIZE)
|
||||
g.projection = plot_config.get("projection", DEFAULT_PROJECTION)
|
||||
g.alpha = plot_config.get("alpha", DEFAULT_ALPHA)
|
||||
return
|
||||
raise samilaDataError(DATA_TYPE_ERROR)
|
||||
|
||||
|
@ -500,5 +503,6 @@ def load_config(g, config):
|
|||
g.bgcolor = plot_config.get("bgcolor", DEFAULT_BACKGROUND_COLOR)
|
||||
g.spot_size = plot_config.get("spot_size", DEFAULT_SPOT_SIZE)
|
||||
g.projection = plot_config.get("projection", DEFAULT_PROJECTION)
|
||||
g.alpha = plot_config.get("alpha", DEFAULT_ALPHA)
|
||||
return
|
||||
raise samilaConfigError(CONFIG_TYPE_ERROR)
|
||||
|
|
|
@ -106,9 +106,18 @@ class GenerativeImage:
|
|||
:type size: tuple
|
||||
:param projection: projection type
|
||||
:type projection: str
|
||||
:param alpha: point transparency
|
||||
:type alpha: float
|
||||
:return: None
|
||||
"""
|
||||
plot_params_filter(self, color, bgcolor, spot_size, size, projection, alpha)
|
||||
plot_params_filter(
|
||||
self,
|
||||
color,
|
||||
bgcolor,
|
||||
spot_size,
|
||||
size,
|
||||
projection,
|
||||
alpha)
|
||||
fig = plt.figure()
|
||||
fig.set_size_inches(self.size[0], self.size[1])
|
||||
fig.set_facecolor(self.bgcolor)
|
||||
|
|
|
@ -161,6 +161,9 @@ False
|
|||
[0]
|
||||
>>> g.data2
|
||||
[1]
|
||||
>>> g_ = GenerativeImage()
|
||||
>>> del(g)
|
||||
>>> del(g_)
|
||||
>>> os.remove("test.png")
|
||||
>>> os.remove("test2.png")
|
||||
>>> os.remove("data.json")
|
||||
|
|
Ładowanie…
Reference in New Issue