kopia lustrzana https://github.com/sepandhaghighi/samila
Profiling (#140)
* fix : profiling added to test system * doc : CHANGELOG updated * fix : profile.py renamed to samila_profile.pypull/141/head
rodzic
73f8fe8ce0
commit
66d2c788d0
|
@ -60,3 +60,6 @@ jobs:
|
|||
run: |
|
||||
codecov
|
||||
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
|
||||
- name: cProfile
|
||||
run: |
|
||||
python -m cProfile -s cumtime otherfiles/samila_profile.py
|
||||
|
|
|
@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|||
## [Unreleased]
|
||||
### Changed
|
||||
- Random mode modified
|
||||
- Test system modified
|
||||
## [0.8] - 2022-06-01
|
||||
### Added
|
||||
- `INVALID_COLOR_TYPE_ERROR` error
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Samila profile."""
|
||||
from samila import *
|
||||
import random
|
||||
import math
|
||||
|
||||
|
||||
def f1(x, y):
|
||||
result = random.uniform(-1, 1) * x**2 - math.sin(y**2) + abs(y-x)
|
||||
return result
|
||||
|
||||
|
||||
def f2(x, y):
|
||||
result = random.uniform(-1, 1) * y**3 - math.cos(x**2) + 2*x
|
||||
return result
|
||||
|
||||
g = GenerativeImage(f1, f2)
|
||||
g.generate(seed=200)
|
||||
g.plot()
|
||||
g.save_image("test.png")
|
Ładowanie…
Reference in New Issue