File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 "username" : " _SYSTEM" ,
2929 "password" : " SYS"
3030 }
31- ]
31+ ],
32+ "python.pythonPath" : " /usr/local/bin/python3"
3233
3334}
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
55ARG IMAGE=intersystemsdc/iris-community:2020.3.0.200.0-zpm
66ARG IMAGE=intersystemsdc/iris-community:2020.3.0.221.0-zpm
77ARG IMAGE=intersystemsdc/iris-community:2020.4.0.524.0-zpm
8+ ARG IMAGE=intersystemsdc/iris-ml-community:2020.3.0.302.0-zpm
89FROM $IMAGE
910
1011USER root
@@ -14,6 +15,7 @@ RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisbuild
1415USER ${ISC_PACKAGE_MGRUSER}
1516
1617# COPY Installer.cls .
18+ COPY python python
1719COPY src src
1820COPY module.xml module.xml
1921COPY 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" \
5858
5959zw ##class(community.csvgen).GenerateFromURL("https://github.com/h2oai/h2o-tutorials/raw/master/h2o-world-2017/automl/data/product_backorders.csv ")
6060
61+ d ##class(dc.python.test).TitanicMeanAge()
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
77 restart : always
88 ports :
99 - 1972
10- - 52773
10+ - 55037: 52773
1111 - 53773
1212 volumes :
1313 - ./:/irisrun/repo
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<Export generator =" Cache" version =" 25" >
3- <Document name =" objectscript -template.ZPM" >
3+ <Document name =" iris-python -template.ZPM" >
44 <Module >
5- <Name >objectscript -template</Name >
6- <Version >1.1.2 </Version >
5+ <Name >iris-python -template</Name >
6+ <Version >0.0.1 </Version >
77 <Packaging >module</Packaging >
88 <SourcesRoot >src</SourcesRoot >
9- <Resource Name =" dc.PackageSample.PKG" />
9+ <Resource Name =" dc.python.PKG" />
10+ <FileCopy Name =" python/" Target =" ${mgrdir}python/" />
1011 </Module >
1112 </Document >
1213</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