
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
A pacakge that allows the user to record and print out neatly the runtime of function and also the entire program.
alexh212
- Alex Hmitti
as13909
- Aaron Stein
Rafinator123
- Rafael Nadal-Scala
jk021227
- Jhon Kim
Times the execution of functions while providing users to save and display recorded runtimes.
Import the provided functions from main.py
into your Python script.
from package_main.main import *
@tracker
When this decorator is applied to a function, Runtime Ponyo begins to time that functions execution.
@tracker_print
When this decorator is applied to a function, Runtime Ponyo begins to time that functions execution and displays the runtime upon completion.
'print_all_runtimes()'
All runtimes recorded are displayed.
This only print the runtimes of functions that have been completed and tracked prior to the call of this function.
save_to_file(file.txt)
This function saves the recorded runtimes to a specified file. If the file doesn't exist, it will be created with the given name, and the runtime data will be written to it.
'entire_runtime()'
Calculates and prints the total runtime of the entire program.
@tracker_print
, apply the decorator to a function.@tracker
def example_function():
for i in range(1000):
i += 1
@tracker_print
, apply the decorator to a function.@tracker_print
def example_function():
for i in range(1000):
i += 1
print_all_runtimes()
function at the desired location in
your program to use it.analyzed_data = complex_data_analysis(pd.concat(processed_chunks))
print_all_runtimes() # Track and print function runtimes
log_operations(datetime.now())
print(f"Analyzed Data: \n{analyzed_data}")
save_to_file()
function at the desired location in your
program to use it.with ThreadPoolExecutor(max_workers=4) as executor:
future_to_chunk = {executor.submit(advanced_data_transformation, chunk): chunk for chunk in chunks}
save_to_file(my_runtimes.txt) # Save recorded runtimes to a specified file
processed_data = [future.result() for future in future_to_chunk]
'entire_runtime()'
function at the desired location in
your program to use it.data = np.random.exponential(scale=1.0, size=(1000, 2))
df = pd.DataFrame(data, columns=['id', 'values'])
chunks = np.array_split(df, 4)
entire_runtime() # Print the total runtime of the program
Here are the steps you need to take if you would like to contribute to the project.
Fork and Clone the project repository
Install pipenv if not already.
Use pipenv
to install all necessary development dependencies.
pipenv install --dev
Set up a new virtual environment using Python.
python -m venv env
Import the main package and the specific functions you wish to test into your test file (_tests.py
located in package/tests
).
Execute your tests using pytest within the pipenv environment
https://pypi.org/project/runtimeponyo/
A little exercise to create a Python package, build it, test it, distribute it, and use it. See instructions for details.
FAQs
A pacakge that allows the user to record and print out neatly the runtime of function and also the entire program.
We found that runtimeponyo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.