Compare commits

...

4 Commits

Author SHA1 Message Date
ymlesni 5feb785439 Update sample_app.py 2024-03-29 11:13:59 +01:00
ymlesni 80d592b6ce Update sample_app.py 2024-03-29 10:57:24 +01:00
ymlesni 2cf466f5ec Update appDefinition.json 2024-03-29 10:52:28 +01:00
ymlesni 1e7014b9a5 Update sample_app.py 2024-03-29 10:52:07 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -18,6 +18,6 @@
"fileName" : "multiplied_numbers_plot.png",
"isReturnedValue" : false
} ],
"requiredTools" : [ "python3" ],
"requiredTools" : [ "python3", "python-numpy" ],
"requiredComputationResources" : { }
}

View File

@ -5,7 +5,7 @@
# Sample function created for demonstration of creating custom applications functionality
# See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications
from numpy import loadtxt
import numpy as np
import matplotlib.pyplot as plt
def main(numbers_file, multiplier):
@ -20,7 +20,9 @@ def main(numbers_file, multiplier):
numbers.
"""
numbers = loadtxt(numbers_file, comments="#", delimiter=",", unpack=False)
numbers = np.genfromtxt(numbers_file, comments="#", delimiter=",", unpack=False)
numbers = numbers[~np.isnan(numbers)]
numbers = np.array(numbers).flatten()
multiplied_numbers = numbers * multiplier
plt.figure()
plt.plot(multiplied_numbers)