corelp 1.0.16__tar.gz → 1.0.18__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 (48) hide show
  1. {corelp-1.0.16 → corelp-1.0.18}/PKG-INFO +3 -1
  2. {corelp-1.0.16 → corelp-1.0.18}/pyproject.toml +2 -2
  3. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/user_inputs_LP/user_inputs.py +24 -6
  4. {corelp-1.0.16 → corelp-1.0.18}/README.md +0 -0
  5. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/__init__.py +0 -0
  6. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/icon_pythonLP.ico +0 -0
  7. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Path_LP/Path.py +0 -0
  8. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Path_LP/__init__.py +0 -0
  9. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Path_LP/test_Path.py +0 -0
  10. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Section_LP/Section.py +0 -0
  11. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Section_LP/__init__.py +0 -0
  12. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/Section_LP/test_Section.py +0 -0
  13. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/__init__.py +0 -0
  14. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/debug_LP/__init__.py +0 -0
  15. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/debug_LP/debug.py +0 -0
  16. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/debug_LP/test_debug.py +0 -0
  17. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/folder_LP/__init__.py +0 -0
  18. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/folder_LP/folder.py +0 -0
  19. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/folder_LP/test_folder.py +0 -0
  20. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/getmodule_LP/__init__.py +0 -0
  21. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/getmodule_LP/getmodule.py +0 -0
  22. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/kwargsself_LP/__init__.py +0 -0
  23. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/kwargsself_LP/kwargsself.py +0 -0
  24. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/kwargsself_LP/test_kwargsself.py +0 -0
  25. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/main_LP/__init__.py +0 -0
  26. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/main_LP/main.py +0 -0
  27. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/main_LP/test_main.py +0 -0
  28. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/print_LP/__init__.py +0 -0
  29. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/print_LP/print.py +0 -0
  30. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/print_LP/test_print.py +0 -0
  31. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/prop_LP/__init__.py +0 -0
  32. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/prop_LP/prop.py +0 -0
  33. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/prop_LP/test_prop.py +0 -0
  34. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/rfrom_LP/__init__.py +0 -0
  35. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/rfrom_LP/rfrom.py +0 -0
  36. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/rfrom_LP/test_rfrom.py +0 -0
  37. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/selfkwargs_LP/__init__.py +0 -0
  38. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/selfkwargs_LP/selfkwargs.py +0 -0
  39. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/selfkwargs_LP/test_selfkwargs.py +0 -0
  40. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/test_LP/__init__.py +0 -0
  41. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/test_LP/test.py +0 -0
  42. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/test_LP/test_test.py +0 -0
  43. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/user_inputs_LP/__init__.py +0 -0
  44. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules/user_inputs_LP/test_user_inputs.py +0 -0
  45. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/modules.json +0 -0
  46. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/py.typed +0 -0
  47. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/scripts/__init__.py +0 -0
  48. {corelp-1.0.16 → corelp-1.0.18}/src/corelp/scripts.json +0 -0
@@ -1,9 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: corelp
3
- Version: 1.0.16
3
+ Version: 1.0.18
4
4
  Summary: A library that gathers core functions for python programming.
5
5
  Requires-Dist: corelp
6
6
  Requires-Dist: ipykernel
7
+ Requires-Dist: ipython
8
+ Requires-Dist: ipywidgets
7
9
  Requires-Dist: joblib
8
10
  Requires-Dist: pytest
9
11
  Requires-Dist: rich
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "corelp"
3
- version = "1.0.16"
3
+ version = "1.0.18"
4
4
  description = "A library that gathers core functions for python programming."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
- dependencies = [ "corelp", "ipykernel", "joblib", "pytest", "rich", "sphinx", "sphinx-design", "sphinx-rtd-theme", "spyder-kernels", "toml",]
7
+ dependencies = [ "corelp", "ipykernel", "ipython", "ipywidgets", "joblib", "pytest", "rich", "sphinx", "sphinx-design", "sphinx-rtd-theme", "spyder-kernels", "toml",]
8
8
 
9
9
  [build-system]
10
10
  requires = [ "uv_build>=0.8.8,<0.9.0",]
@@ -14,6 +14,7 @@ Gets last user inputs dictionnary from global variables.
14
14
 
15
15
  # %% Libraries
16
16
  import inspect
17
+ from IPython import get_ipython
17
18
 
18
19
 
19
20
 
@@ -48,12 +49,29 @@ def user_inputs() :
48
49
  {'a': 1}
49
50
  """
50
51
 
51
- frame = inspect.currentframe().f_back
52
- current_vars = {**frame.f_globals, **frame.f_locals}
53
- current_vars = {k: v for k, v in current_vars.items() if not k.startswith("_")}
54
- inputs = {k: v for k, v in current_vars.items() if k not in _user_inputs or _user_inputs[k] != v}
55
- _user_inputs.update(inputs)
56
- return inputs
52
+ # ---- Detect execution environment ----
53
+ ipy = get_ipython()
54
+
55
+ if ipy is not None:
56
+ # Running in IPython or Jupyter
57
+ ns = ipy.user_ns
58
+ else:
59
+ # Running in normal Python script
60
+ frame = inspect.currentframe().f_back
61
+ ns = {**frame.f_globals, **frame.f_locals}
62
+
63
+ # ---- Filter user variables (ignore internals starting with "_") ----
64
+ ns = {k: v for k, v in ns.items() if not k.startswith("_")}
65
+
66
+ # ---- Return only new or updated variables ----
67
+ updated = {
68
+ k: v
69
+ for k, v in ns.items()
70
+ if k not in _user_inputs or _user_inputs[k] is not v
71
+ }
72
+
73
+ _user_inputs.update(updated)
74
+ return updated
57
75
 
58
76
 
59
77
 
File without changes
File without changes
File without changes
File without changes
File without changes