Skip to content

Commit

Permalink
Updated to v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bshoshany committed Sep 8, 2024
1 parent 793cd74 commit 3db066d
Show file tree
Hide file tree
Showing 18 changed files with 22,600 additions and 7,778 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__pycache__
.ipynb_checkpoints
.OGRePy-env
temp
misc/temp
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
"ipykernel",
"ipynb",
"jupyterlab",
"jupytext",
"Lagrangians",
"lativity",
"logcombine",
"longrightarrow",
"mathbf",
"mathrm",
"nabla",
"nbconvert",
"nserc",
"ogrepy",
"permutedims",
Expand Down
14 changes: 9 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"type": "shell"
},
{
"args": [],
"command": "tasks/cleanup.ps1",
"args": [
"tasks/cleanup.py"
],
"command": "${command:python.interpreterPath}",
"detail": "Clean up cache folders.",
"group": "test",
"label": "Clean up",
Expand All @@ -33,9 +35,11 @@
"type": "shell"
},
{
"args": [],
"command": "tasks/compile_docs.ps1",
"detail": "Compile the Markdown documentation to a Jupyter notebook.",
"args": [
"tasks/compile_docs.py"
],
"command": "${command:python.interpreterPath}",
"detail": "Compile the Markdown documentation.",
"group": "test",
"label": "Compile docs",
"presentation": {
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,23 @@ GitHub repository: <https://github.com/bshoshany/OGRePy>\
PyPi project: <https://pypi.org/project/OGRePy/>

* [Version history](#version-history)
* [v1.1.0 (2024-09-08)](#v110-2024-09-08)
* [v1.0.1 (2024-09-04)](#v101-2024-09-04)

## Version history

### v1.1.0 (2024-09-08)

* Bug fixes:
* Fixed a bug where tensor contraction failed when generating a symbol for the new tensor. See [#1](https://github.com/bshoshany/OGRePy/issues/1).
* Fixed math in documentation (apparently Jupyter and GitHub have very different rules with regards to displaying math).
* New features:
* The documentation is now available in HTML format ([`OGRePy_Documentation.html`](https://github.com/bshoshany/OGRePy/blob/master/docs/OGRePy_Documentation.html)) and PDF format ([`OGRePy_Documentation.pdf`](https://github.com/bshoshany/OGRePy/blob/master/docs/OGRePy_Documentation.pdf)) in addition to Jupyter Notebook format ([`OGRePy_Documentation.ipynb`](https://github.com/bshoshany/OGRePy/blob/master/docs/OGRePy_Documentation.ipynb)).
* Added links to open the documentation in any of these three formats to the welcome message. Note that the documentation is bundled with the package, so this will work offline as well.
* The welcome message can now be disabled either by defining `OGREPY_DISABLE_WELCOME = True` in the notebook or by setting the environment variable `OGREPY_DISABLE_WELCOME` to `True` (which allows you to disable it permanently). This must be done before importing the package.
* The package now automatically checks for updates from [PyPI](https://pypi.org/project/OGRePy/) when it is imported. This can be disabled by defining `OGREPY_DISABLE_UPDATE_CHECK = True` in the notebook, or setting the environment variable `OGREPY_DISABLE_UPDATE_CHECK` to `True`, before importing the package. In that case, you can still check for updates manually if you wish, using `T.update_check()`. However, note that this check is performed asynchronously, so it does not increase the load time of the package, and you can continue working while the check is being performed. If the welcome message is disabled, the startup update check is performed in "quiet mode", meaning that it only notifies you if a new version is available, but not if you are running the latest version.
* Changing the curve parameter now applies retroactively to any tensors previously calculated. Behind the scenes, the curve parameter is stored only as a placeholder, which is replaced dynamically with the user's chosen symbol when the components are displayed with `show()` or `list()` or extracted with `components()`.

### v1.0.1 (2024-09-04)

* Initial release.
Expand Down
11 changes: 3 additions & 8 deletions OGRePy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
r"""
# OGRePy: An Object-Oriented General Relativity Package for Python
v1.1.0 (2024-09-08)
By **Barak Shoshany**\
Email: <baraksh@gmail.com>\
Expand All @@ -20,13 +21,7 @@
import sympy as s

# Import all public OGRePy objects.
from ._core import Coordinates, CovariantD, Metric, OGRePyError, PartialD, Tensor, __version__, calc, diag, doc, func, info, options, release_date, sym, syms, welcome
from ._core import Coordinates, CovariantD, Metric, OGRePyError, PartialD, Tensor, __version__, calc, diag, doc, func, info, options, release_date, sym, syms, update_check, welcome

# The names that will be exported if using `from OGRePy import *`. Contains exactly all the names imported above.
__all__: list[str] = ["s", "Coordinates", "CovariantD", "Metric", "OGRePyError", "PartialD", "Tensor", "__version__", "calc", "diag", "doc", "func", "info", "options", "release_date", "sym", "syms", "welcome"]

# Display the welcome message, but not if `OGREPY_DISABLE_WELCOME = True` was defined in the notebook before importing the package.
import __main__

if __main__.__dict__.get("OGREPY_DISABLE_WELCOME", False) is not True:
welcome()
__all__: list[str] = ["s", "Coordinates", "CovariantD", "Metric", "OGRePyError", "PartialD", "Tensor", "__version__", "calc", "diag", "doc", "func", "info", "options", "release_date", "sym", "syms", "update_check", "welcome"]
Loading

0 comments on commit 3db066d

Please sign in to comment.