diffstep 1.1.1__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.3/CHANGELOG.txt +54 -0
- {diffstep-1.1.1/diffstep.egg-info → diffstep-1.1.3}/PKG-INFO +1 -1
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/__init__.py +2 -0
- diffstep-1.1.3/diffstep/pipeline.py +57 -0
- {diffstep-1.1.1 → diffstep-1.1.3/diffstep.egg-info}/PKG-INFO +1 -1
- {diffstep-1.1.1 → diffstep-1.1.3}/pyproject.toml +1 -1
- {diffstep-1.1.1 → diffstep-1.1.3}/setup.py +1 -1
- diffstep-1.1.1/CHANGELOG.txt +0 -22
- diffstep-1.1.1/diffstep/pipeline.py +0 -29
- {diffstep-1.1.1 → diffstep-1.1.3}/LICENSE.txt +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/MANIFEST.in +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/README.md +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/__init__.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/nodes.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/normalise.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/parser.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/tokeniser.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/differentiation/__init__.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/differentiation/derivative.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/printer/__init__.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/printer/to_string.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/simplify/__init__.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/simplify/simplify.py +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/SOURCES.txt +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/dependency_links.txt +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/top_level.txt +0 -0
- {diffstep-1.1.1 → diffstep-1.1.3}/setup.cfg +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## [1.0.0] - 2026-02-13
|
|
4
|
+
### Added
|
|
5
|
+
- Initial public release of diffstep
|
|
6
|
+
- Expression validation and normalization
|
|
7
|
+
- Tokenization engine
|
|
8
|
+
- AST parser
|
|
9
|
+
- Symbolic differentiation
|
|
10
|
+
- AST to string printer
|
|
11
|
+
- Expression simplification
|
|
12
|
+
|
|
13
|
+
## [1.1.0] - 2026-03-02
|
|
14
|
+
### Added
|
|
15
|
+
- New lowercase `diffstep()` public API function
|
|
16
|
+
|
|
17
|
+
### Deprecated
|
|
18
|
+
- `DiffStep()` function is now deprecated and will be removed in a future major version
|
|
19
|
+
- Users should migrate to `diffstep()`
|
|
20
|
+
|
|
21
|
+
### Internal
|
|
22
|
+
- Improved API consistency (PEP8 naming conventions)
|
|
23
|
+
|
|
24
|
+
## [1.1.1] - 2026-03-03
|
|
25
|
+
### Bugfix
|
|
26
|
+
- Fixed bug where you could not import diffstep from terminal
|
|
27
|
+
|
|
28
|
+
## [1.1.2] - 2026-03-13
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- Layered API design to support both beginner and advanced users
|
|
32
|
+
- Simple entry-point function `diffstep()` for quick differentiation
|
|
33
|
+
- Additional public functions for more granular control of the differentiation pipeline
|
|
34
|
+
- Support for accessing lower-level functions through `import diffstep` (e.g. `diffstep.differentiate()`)
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Improved package structure to expose both high-level and low-level APIs
|
|
38
|
+
- Updated `__init__.py` to limit wildcard imports (`from diffstep import *`) to the beginner-friendly `diffstep()` function
|
|
39
|
+
|
|
40
|
+
### Developer
|
|
41
|
+
- Refactored internal pipeline to support multiple public entry points
|
|
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,4 +1,6 @@
|
|
|
1
1
|
from .pipeline import DiffStep, diffstep
|
|
2
|
+
from .pipeline import differentiate, gradient, normalise_expression
|
|
3
|
+
# from .pipeline import tokenise_expression, parse_expression, derived_ast
|
|
2
4
|
|
|
3
5
|
__all__ = ["DiffStep", "diffstep"]
|
|
4
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.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
import sympy as sp
|
|
3
|
+
|
|
4
|
+
from diffstep.core.normalise import validate_and_normalise as normalise
|
|
5
|
+
from diffstep.core.tokeniser import tokenize
|
|
6
|
+
from diffstep.core.parser import parse
|
|
7
|
+
from diffstep.differentiation.derivative import differentiate as _differentiate
|
|
8
|
+
from diffstep.printer.to_string import ast_to_string
|
|
9
|
+
from diffstep.simplify.simplify import simplify
|
|
10
|
+
|
|
11
|
+
# This is the main function that users will call to differentiate an expression.
|
|
12
|
+
def DiffStep(expression: str):
|
|
13
|
+
warnings.warn(
|
|
14
|
+
"DiffStep is deprecated and will be removed in a future version. \n "
|
|
15
|
+
"Use 'diffstep' instead.",
|
|
16
|
+
category=DeprecationWarning,
|
|
17
|
+
stacklevel=2
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
return diffstep(expression)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def diffstep(expression: str):
|
|
24
|
+
normalised_expression = normalise(expression)
|
|
25
|
+
tokens = tokenize(normalised_expression)
|
|
26
|
+
ast = parse(tokens)
|
|
27
|
+
derivative_ast = _differentiate(ast)
|
|
28
|
+
result = simplify(derivative_ast)
|
|
29
|
+
|
|
30
|
+
return result
|
|
31
|
+
|
|
32
|
+
def differentiate(expression: str):
|
|
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)
|
diffstep-1.1.1/CHANGELOG.txt
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
|
|
3
|
-
## [1.0.0] - 2026-02-13
|
|
4
|
-
### Added
|
|
5
|
-
- Initial public release of diffstep
|
|
6
|
-
- Expression validation and normalization
|
|
7
|
-
- Tokenization engine
|
|
8
|
-
- AST parser
|
|
9
|
-
- Symbolic differentiation
|
|
10
|
-
- AST to string printer
|
|
11
|
-
- Expression simplification
|
|
12
|
-
|
|
13
|
-
## [1.1.0] - 2026-03-02
|
|
14
|
-
### Added
|
|
15
|
-
- New lowercase `diffstep()` public API function
|
|
16
|
-
|
|
17
|
-
### Deprecated
|
|
18
|
-
- `DiffStep()` function is now deprecated and will be removed in a future major version
|
|
19
|
-
- Users should migrate to `diffstep()`
|
|
20
|
-
|
|
21
|
-
### Internal
|
|
22
|
-
- Improved API consistency (PEP8 naming conventions)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
|
|
3
|
-
from diffstep.core.normalise import validate_and_normalise as normalise
|
|
4
|
-
from diffstep.core.tokeniser import tokenize
|
|
5
|
-
from diffstep.core.parser import parse
|
|
6
|
-
from diffstep.differentiation.derivative import differentiate
|
|
7
|
-
from diffstep.printer.to_string import ast_to_string
|
|
8
|
-
from diffstep.simplify.simplify import simplify
|
|
9
|
-
|
|
10
|
-
# This is the main function that users will call to differentiate an expression.
|
|
11
|
-
def DiffStep(expression: str):
|
|
12
|
-
warnings.warn(
|
|
13
|
-
"DiffStep is deprecated and will be removed in a future version. \n "
|
|
14
|
-
"Use 'diffstep' instead.",
|
|
15
|
-
category=DeprecationWarning,
|
|
16
|
-
stacklevel=2
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
return diffstep(expression)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def diffstep(expression: str):
|
|
23
|
-
normalised_expression = normalise(expression)
|
|
24
|
-
tokens = tokenize(normalised_expression)
|
|
25
|
-
ast = parse(tokens)
|
|
26
|
-
derivative_ast = differentiate(ast)
|
|
27
|
-
result = simplify(derivative_ast)
|
|
28
|
-
|
|
29
|
-
return result
|
|
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
|