Python is an interpreted high-level programming language for general-purpose programming. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace
I am trying to create a database using python. The example shows setting a Name string and a Properties object containing Directory=.
; Use class methods to create an instance
%SYS>s Name="ABC"
%SYS>s Properties("Directory")="c:\abc\"
%SYS>s Status=##Class(Config.Databases).Create(Name,.Properties)
%SYS>i '$$$ISOK(Status) w !,"Error="_$SYSTEM.Status.GetErrorText(Status)
How do I update and pass the Directory property using Python?
I'm exploring this right now: given a bunch of types defined as Pydantic models, how can I come up with an equivalent %RegisteredObject/%SerialObject and convert to/from (e.g., to support persistence and match validation as much as possible)?
People who know Python better than I do (e.g., your average undergraduate from this decade): is this a stupid idea or a cool idea? Has anyone else done this before?
I'm trying to create an indexed table with an vector field so I can search by the vector value. I've been investigating and found that to get the vector value based on the text (token), use a Python method like the following:
When setting up a new web app in iris (iris is in a container) iris complains that a WSGI framework is not installed. I have installed python into the container as well as both flask and django via the python virtual environment (see second screenshot) and the python language server is running
Is this the wrong way to install flask? How do I get the container version to recoginize that flask is installed?
Hi, I'm trying to use the iris python package to create a connection to and Iris Health instance (Docker Container), but getting and error. I can login to the instance using the UI with the same uname/password but unable to create the python connection. Any suggestions?
I'm getting an unexpected behavior when using pandas function to_sql(), which uses sqlalchemy-iris. After the first execution, a transaction seems to be opened and all rows inserted are lost after closing the connection:
If anyone has experience debugging Embedded Python or has insight into why an ObjectScript method when called from a Python method would not work but would work when called directly via ObjectScript or in a Python shell, your help would be appreciated!
We have an ObjectScript ClassMethod called GetTemplateString() which takes in a templateName of String type and uses the template name to get the template object, access the Code, and read the code into a templateString. The string version of the Code is returned.
How to convert the IRIS %DynamicArray into python list. I got " <THROW>TestDyncArray+1^MyLearn.Pyth.NewClass1.1 *%Exception.PythonException <PYTHON EXCEPTION> 246 <class 'AttributeError'>: <unknown exception data>" error when passing array values to python class.
Some days ago, I've seen a youtuber talking about how to create a neural network (sorry, is in spanish)
https://www.youtube.com/embed/iX_on3VxZzk [This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]
When registering the components: I used this command: "Utils.migrate("/external/src/CoreModel/Python/settings.py)" ; The error appears: "An error has occurred: iris.cls: error finding class", I changed with these two lines: result = subprocess.run(["iop", "-m", "/external/src/CoreModel/Python/settings.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) subprocess.run(["iop", "-m", "/external/src/CoreModel/Python/settings.py"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=True)
Recently, I've been working on a Business Process that processes a large JSON FHIR message containing up to 50k requests in an array within the JSON.
Currently, the code imports the JSON as a dynamic object from the original message stream, obtains an iterator from it, and processes each request one at a time in a loop.
I'm trying to convert a python dictionary into an objectscript array but there is an issue with the 'arrayref' function, that is not working as in the linked example.
Using VECTOR_COSINE() in SQL query to perform a text similarity search on existing embeddings in a %VECTOR column.
Code is below.
Commented out sql query returns this error: SQLCODE: -29 Field 'NEW_EMBEDDING_STR' not found in the applicable tables^ SELECT TOP ? maxID , activity , outcome FROMMain .AITest ORDER BY VECTOR_COSINE ( new_embedding_str ,
Sql query as written returns ERROR #5002: ObjectScript error: <PYTHON EXCEPTION> *<class 'OSError'>: isc_stdout_write: PyArg_ParseTuple failed!
$ZF(-100) to run python script not work when directly execute in studio or in storedproc called by TrakCare, but can work when do in iris session.
The python script imports a "barcode" package. It seems that when directly execute in studio or in storedproc called by TrakCare, the package can not be imported.
I have a question about the python version, I read in the documentation that the compatible version is 3.9.5 for the proper functioning of python on Iris.
Do we have to stay on this version or can we use newer versions?
I have an existing Python script that opens a child session using the pexpect library. But currently all it does is send hard-coded commands to the Cache process and expect a hard-coded response back in order to continue in the script.
I would like to run a Cache routine from the script, pass in a parameter, and wait for a response that will be different every time (a date, in this case). So the call would be something like D $$Tag^Routine(parameter) and wait for the routine to complete and return the response.
Could you please help anyone how to import Python package in %SYSTEM package and to use python methods to write in object script class?
I used the following link to install the Python but I can't see the Python package in %SYSTEM package and my program throwing the Class Does not exist error?
I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.
The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.
When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":
I've asked my teammate to open a WRC on this issue, but wanted to open the discussion to see if maybe we aren't the first people to see this issue.
The code we are deploying is a COS object with some Python methods. The code works fine locally on the developer's machine. However, when the business process runs in the server environment, we see the following when COS code attempts to call a [Language = python] method: