PythonSampleAppEnv/sample_app.py

30 lines
1.0 KiB
Python
Raw Normal View History

2025-05-20 12:18:10 +02:00
# -----------------
# Copyright © 2025 ACK Cyfronet AGH, Poland.
# -----------------
#
# Sample function created for demonstration of creating custom applications functionality
# See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications
2025-05-20 21:21:07 +02:00
#import numpy as np
2025-05-19 17:29:12 +02:00
def main(numbers_file, multiplier):
"""
2025-05-20 12:18:10 +02:00
Example Python application that reads the given numbers_file and multiplies
the content (numbers) by the supplied multiplier
2025-05-19 17:29:12 +02:00
Arguments:
numbers_file: path to input file of type 'text_data'
2025-05-20 12:18:10 +02:00
multiplier: number by which the array of numbers is multiplied
2025-05-19 17:29:12 +02:00
Returns:
2025-05-20 12:18:10 +02:00
A file named 'multiplied_numbers_plot.png' containing a plot of multiplied
numbers.
2025-05-19 17:29:12 +02:00
"""
2025-05-20 21:20:46 +02:00
#numbers = np.genfromtxt(numbers_file, comments="#", delimiter=",", unpack=False)
#numbers = numbers[~np.isnan(numbers)]
#numbers = np.array(numbers).flatten()
#multiplied_numbers = numbers * multiplier
2025-05-20 21:20:00 +02:00
2025-05-20 21:20:19 +02:00
f=open("multiplied_numbers_plot.png","w+")
2025-05-20 21:20:00 +02:00
f.write(text)
f.write("\n")
f.close()