Skip to main content

simutils

Note that this package is not yet implemented.

Usage

It logs the argument of the function and other relevant information to a JSON file.

>>> from simutils import log_function

>>> @log_function
... def double_val(x):
...    return x * 2
...
>>> double_val(4)
8

Then the content of the JSON file will be:

{
    "simulation_name": "double_val_20210216_141001",
    "status": "success",
    "computer_name": "MyComputer",
    "python_version": "3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]",
    "cwd": "current/working/directory",
    "output_directory": "logs/double_val_20210216_141001",
    "summary_filepath": "path/to/this/file",
    "called_function": "double_val",
    "start_time": "2021-02-16 14:10:02",
    "end_time": "2021-02-16 14:10:03",
    "simulation_time": "0:00:01.012345",
    "args": {
        "x": 4
    }
}

You can pass arguments to the decorator, and you can also decorate functions in a Python script.

@log_function(
    git_repo=os.path.join(os.path.dirname(__file__), '..', '..'), # git repository to log
)
def triple_val(x):
    return x * 3

To-Do's

  • Send a notification when a function execution is finished.
  • Integrate with a native Python logger.
  • Reproduce the original environment

Metadata

Release files for simutils 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simutils 0.0.2
File Size Uploaded Provenance
simutils-0.0.2.tar.gz 2.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simutils 0.0.2
File Interpreter ABI Platform
simutils-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / simutils-0.0.2.tar.gz

Download URL simutils-0.0.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7f046aece3da43fc8b8046326df5f2eb16fa2f6e7ebd55e2d3f2ed0cce38b2b9
BLAKE2b-256 checksum
How to use checksums
bddcbaab9263ee5b865f53cbc38513ab7879b62f2839953b2e3a62dd6bb2479d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / simutils-0.0.2-py3-none-any.whl

Download URL simutils-0.0.2-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c0658ebc752e4699a9f17a664a5e81db72b115ecea5731c94228f75f8f3daad
BLAKE2b-256 checksum
How to use checksums
7fcea298d67be65084dcf026ad710eb5c484ee2008681b08aac6ee64e342e99e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Security for simutils 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page