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.
Files changed (27) hide show
  1. diffstep-1.1.3/CHANGELOG.txt +54 -0
  2. {diffstep-1.1.1/diffstep.egg-info → diffstep-1.1.3}/PKG-INFO +1 -1
  3. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/__init__.py +2 -0
  4. diffstep-1.1.3/diffstep/pipeline.py +57 -0
  5. {diffstep-1.1.1 → diffstep-1.1.3/diffstep.egg-info}/PKG-INFO +1 -1
  6. {diffstep-1.1.1 → diffstep-1.1.3}/pyproject.toml +1 -1
  7. {diffstep-1.1.1 → diffstep-1.1.3}/setup.py +1 -1
  8. diffstep-1.1.1/CHANGELOG.txt +0 -22
  9. diffstep-1.1.1/diffstep/pipeline.py +0 -29
  10. {diffstep-1.1.1 → diffstep-1.1.3}/LICENSE.txt +0 -0
  11. {diffstep-1.1.1 → diffstep-1.1.3}/MANIFEST.in +0 -0
  12. {diffstep-1.1.1 → diffstep-1.1.3}/README.md +0 -0
  13. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/__init__.py +0 -0
  14. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/nodes.py +0 -0
  15. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/normalise.py +0 -0
  16. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/parser.py +0 -0
  17. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/core/tokeniser.py +0 -0
  18. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/differentiation/__init__.py +0 -0
  19. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/differentiation/derivative.py +0 -0
  20. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/printer/__init__.py +0 -0
  21. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/printer/to_string.py +0 -0
  22. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/simplify/__init__.py +0 -0
  23. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep/simplify/simplify.py +0 -0
  24. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/SOURCES.txt +0 -0
  25. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/dependency_links.txt +0 -0
  26. {diffstep-1.1.1 → diffstep-1.1.3}/diffstep.egg-info/top_level.txt +0 -0
  27. {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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffstep
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: A symbolic differentiation library.
5
5
  Home-page: https://campus.cs.le.ac.uk/gitlab/ug_project/25-26/aoe8
6
6
  Author: Ayo
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffstep
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: A symbolic differentiation library.
5
5
  Home-page: https://campus.cs.le.ac.uk/gitlab/ug_project/25-26/aoe8
6
6
  Author: Ayo
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "diffstep"
7
- version = "1.1.1"
7
+ version = "1.1.3"
8
8
  description = "A symbolic differentiation library."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -11,7 +11,7 @@ classifiers = [
11
11
 
12
12
  setup (
13
13
  name='diffstep',
14
- version='1.1.1',
14
+ version='1.1.3',
15
15
  description="This is a library for Algorithmic Differentiation.",
16
16
  long_description=open('README.md').read(),
17
17
  long_description_content_type='text/markdown',
@@ -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