File tree Expand file tree Collapse file tree 10 files changed +963
-47
lines changed Expand file tree Collapse file tree 10 files changed +963
-47
lines changed Original file line number Diff line number Diff line change 28
28
"username" : " _SYSTEM" ,
29
29
"password" : " SYS"
30
30
}
31
- ]
31
+ ],
32
+ "python.pythonPath" : " /usr/local/bin/python3"
32
33
33
34
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm
5
5
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.200.0-zpm
6
6
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.221.0-zpm
7
7
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.524.0-zpm
8
+ ARG IMAGE=intersystemsdc/iris-ml-community:2020.3.0.302.0-zpm
8
9
FROM $IMAGE
9
10
10
11
USER root
@@ -14,6 +15,7 @@ RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisbuild
14
15
USER ${ISC_PACKAGE_MGRUSER}
15
16
16
17
# COPY Installer.cls .
18
+ COPY python python
17
19
COPY src src
18
20
COPY module.xml module.xml
19
21
COPY iris.script iris.script
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -58,3 +58,4 @@ zn "%SYS" \
58
58
59
59
zw ##class(community.csvgen).GenerateFromURL("https://github.com/h2oai/h2o-tutorials/raw/master/h2o-world-2017/automl/data/product_backorders.csv ")
60
60
61
+ d ##class(dc.python.test).TitanicMeanAge()
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
7
7
restart : always
8
8
ports :
9
9
- 1972
10
- - 52773
10
+ - 55037: 52773
11
11
- 53773
12
12
volumes :
13
13
- ./:/irisrun/repo
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<Export generator =" Cache" version =" 25" >
3
- <Document name =" objectscript -template.ZPM" >
3
+ <Document name =" iris-python -template.ZPM" >
4
4
<Module >
5
- <Name >objectscript -template</Name >
6
- <Version >1.1.2 </Version >
5
+ <Name >iris-python -template</Name >
6
+ <Version >0.0.1 </Version >
7
7
<Packaging >module</Packaging >
8
8
<SourcesRoot >src</SourcesRoot >
9
- <Resource Name =" dc.PackageSample.PKG" />
9
+ <Resource Name =" dc.python.PKG" />
10
+ <FileCopy Name =" python/" Target =" ${mgrdir}python/" />
10
11
</Module >
11
12
</Document >
12
13
</Export >
Original file line number Diff line number Diff line change
1
+ import numpy as np
2
+ import pandas as pd
3
+
4
+ def hello ():
5
+ return "world"
6
+
7
+ def meanage (filename = "titanic.csv" ):
8
+ # Read data
9
+ titanic = pd .read_csv (filename ,"," )
10
+
11
+ # Set passenger ages to a NumPy array
12
+ passenger_ages = titanic ['Age' ]
13
+ #print(passenger_ages)
14
+
15
+ # Use numpy to calculate the mean age of passengers
16
+ mean_age = np .nanmean (passenger_ages )
17
+
18
+ #print(mean_age)
19
+
20
+ return str (mean_age )
21
+
22
+ #print(meanage())
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ Class dc .python .test
2
+ {
3
+
4
+ ClassMethod HelloWorld () As %Status
5
+ {
6
+ Set sc = $$$OK
7
+ Set b = ##class (%SYS.Python ).Import (" builtins" )
8
+ Do b .print (" Hello world" )
9
+ Return sc
10
+ }
11
+
12
+ ClassMethod Today () As %Status
13
+ {
14
+ Set sc = $$$OK
15
+ Set dt = ##class (%SYS.Python ).Import (" datetime" )
16
+ write dt .date .today ().isoformat ()
17
+ Return sc
18
+ }
19
+
20
+ ClassMethod Hello () As %Status
21
+ {
22
+ Set sc = $$$OK
23
+ Set sm = ##class (%SYS.Python ).Import (" sample" )
24
+ write sm .hello ()
25
+ Return sc
26
+ }
27
+
28
+ /// Titanic
29
+ ClassMethod TitanicMeanAge () As %Status
30
+ {
31
+ Set sc = $$$OK
32
+ set tt =##class (%SYS.Python ).Import (" sample" )
33
+ set mean =tt .meanage (" /irisrun/repo/data/titanic.csv" )
34
+ write " mean age=" _mean
35
+ Return sc
36
+ }
37
+
38
+ }
You can’t perform that action at this time.
0 commit comments