diffstep 1.1.2__tar.gz → 1.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diffstep-1.1.2 → diffstep-1.1.3}/CHANGELOG.txt +13 -1
- {diffstep-1.1.2/diffstep.egg-info → diffstep-1.1.3}/PKG-INFO +1 -1
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/__init__.py +2 -1
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/pipeline.py +25 -0
- {diffstep-1.1.2 → diffstep-1.1.3/diffstep.egg-info}/PKG-INFO +1 -1
- {diffstep-1.1.2 → diffstep-1.1.3}/pyproject.toml +1 -1
- {diffstep-1.1.2 → diffstep-1.1.3}/setup.py +1 -1
- {diffstep-1.1.2 → diffstep-1.1.3}/LICENSE.txt +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/MANIFEST.in +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/README.md +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/core/__init__.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/core/nodes.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/core/normalise.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/core/parser.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/core/tokeniser.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/differentiation/__init__.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/differentiation/derivative.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/printer/__init__.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/printer/to_string.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/simplify/__init__.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep/simplify/simplify.py +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep.egg-info/SOURCES.txt +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep.egg-info/dependency_links.txt +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/diffstep.egg-info/top_level.txt +0 -0
- {diffstep-1.1.2 → diffstep-1.1.3}/setup.cfg +0 -0
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
### Bugfix
|
|
26
26
|
- Fixed bug where you could not import diffstep from terminal
|
|
27
27
|
|
|
28
|
-
## [1.2
|
|
28
|
+
## [1.1.2] - 2026-03-13
|
|
29
29
|
|
|
30
30
|
### Added
|
|
31
31
|
- Layered API design to support both beginner and advanced users
|
|
@@ -40,3 +40,15 @@
|
|
|
40
40
|
### Developer
|
|
41
41
|
- Refactored internal pipeline to support multiple public entry points
|
|
42
42
|
|
|
43
|
+
## [1.1.3] - 2026-03-17
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- New `gradient(expression, x_value)` function to evaluate the derivative at a specific x-value
|
|
47
|
+
- New `normalise_expression(expression)` helper for expression normalization
|
|
48
|
+
- New `tokenise_expression(expression)` helper for expression tokenization
|
|
49
|
+
- New `parse_expression(expression)` helper for parsing expressions into AST form
|
|
50
|
+
- New `derived_ast(expression)` helper to return the derivative AST before simplification
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
- Expanded pipeline-level API to support step-by-step differentiation workflows
|
|
54
|
+
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .pipeline import DiffStep, diffstep
|
|
2
|
-
from .pipeline import differentiate
|
|
2
|
+
from .pipeline import differentiate, gradient, normalise_expression
|
|
3
|
+
# from .pipeline import tokenise_expression, parse_expression, derived_ast
|
|
3
4
|
|
|
4
5
|
__all__ = ["DiffStep", "diffstep"]
|
|
5
6
|
# This file shows what can be called when you import diffstep. It also allows you to import from diffstep without having to specify the submodule, e.g. from diffstep import DiffStep instead of from diffstep.pipeline import DiffStep.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import warnings
|
|
2
|
+
import sympy as sp
|
|
2
3
|
|
|
3
4
|
from diffstep.core.normalise import validate_and_normalise as normalise
|
|
4
5
|
from diffstep.core.tokeniser import tokenize
|
|
@@ -30,3 +31,27 @@ def diffstep(expression: str):
|
|
|
30
31
|
|
|
31
32
|
def differentiate(expression: str):
|
|
32
33
|
return diffstep(expression)
|
|
34
|
+
|
|
35
|
+
def gradient(expression: str, x_value: float):
|
|
36
|
+
x = sp.symbols('x')
|
|
37
|
+
derivative = diffstep(expression)
|
|
38
|
+
gradient_value = derivative.subs(x, x_value)
|
|
39
|
+
return gradient_value
|
|
40
|
+
|
|
41
|
+
def normalise_expression(expression: str):
|
|
42
|
+
return normalise(expression)
|
|
43
|
+
|
|
44
|
+
def tokenise_expression(expression: str):
|
|
45
|
+
normalised_expression = normalise(expression)
|
|
46
|
+
return tokenize(normalised_expression)
|
|
47
|
+
|
|
48
|
+
def parse_expression(expression: str):
|
|
49
|
+
normalised_expression = normalise(expression)
|
|
50
|
+
tokens = tokenize(normalised_expression)
|
|
51
|
+
return parse(tokens)
|
|
52
|
+
|
|
53
|
+
def derived_ast(expression: str):
|
|
54
|
+
normalised_expression = normalise(expression)
|
|
55
|
+
tokens = tokenize(normalised_expression)
|
|
56
|
+
ast = parse(tokens)
|
|
57
|
+
return _differentiate(ast)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|