7 Commits

Author SHA1 Message Date
tcs-test-user ec90c655ea Added required dependency to appDefinition.json 2025-05-21 18:06:23 +02:00
tcs-test-user 310f27e572 Update README.md 2025-05-06 09:23:11 +02:00
tcs-test-user cd7afd418b Correction of required tools 2025-05-06 09:21:59 +02:00
tcs-test-user 36453824a9 revert 263e47d87a
revert Update appDefinition.json
2025-02-06 14:49:46 +01:00
tcs-test-user 263e47d87a Update appDefinition.json 2025-02-06 14:01:55 +01:00
tcs-test-user 3f4919ffe7 ISL-4698 Fixed python script so it reads provided data properly 2024-03-29 11:16:43 +01:00
tcs-test-user aafadf4581 ISL-4698 Added python-numpy to requiredTools 2024-03-29 09:50:18 +01:00
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -1,9 +1,9 @@
# PythonSampleApp # PythonSampleApp
This application shows: This application shows:
- basic usage of input files in Python applications
- basic usage of input files in Python applications - basic usage of input files in Python applications
- creating and returning output file in Python application - creating and returning output file in Python application
- declaring Matplotlib dependency
Contents of the repository: Contents of the repository:
- [appDefinition.json](appDefinition.json) - application definition descriptor - [appDefinition.json](appDefinition.json) - application definition descriptor
+1 -1
View File
@@ -18,6 +18,6 @@
"fileName" : "multiplied_numbers_plot.png", "fileName" : "multiplied_numbers_plot.png",
"isReturnedValue" : false "isReturnedValue" : false
} ], } ],
"requiredTools" : [ "python3", "python-numpy" ], "requiredTools" : [ "python3", "python-numpy", "python-matplotlib" ],
"requiredComputationResources" : { } "requiredComputationResources" : { }
} }
+5 -3
View File
@@ -5,7 +5,7 @@
# Sample function created for demonstration of creating custom applications functionality # Sample function created for demonstration of creating custom applications functionality
# See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications # See also https://docs.cyfronet.pl/display/ISDOC/Creating+Custom+Applications
from numpy import loadtxt import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
def main(numbers_file, multiplier): def main(numbers_file, multiplier):
@@ -20,8 +20,10 @@ def main(numbers_file, multiplier):
numbers. 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 multiplied_numbers = numbers * multiplier
plt.figure() plt.figure()
plt.plot(multiplied_numbers) plt.plot(multiplied_numbers)
plt.savefig('multiplied_numbers_plot.png') plt.savefig('multiplied_numbers_plot.png')