PyCaret and Google Cloud Function - google-cloud-functions

I try to use PyCaret in a Google Cloud Function but I cannot import the classification modules (from pycaret.classification import *) because there is a reference to a non writable directory (OSError: [Errno 30] Read-only file system: '/workspace/logs.log') Does anybody know a workaround or does that mean that PyCaret is not compliant with Cloud Function yet ?

The PyCaret team has fixed the problem in the current nigthly builds of the module and it is now working fine with Cloud Functions. Thank you guys :)

Related

PlotlyJS.jl "savehtml" not defined

I need to share an interactive plot made using the PlotlyJS package in Julia. According to the documentation of the package PlotlyJS.jl, I need to use the "savehtml" function and set "js" argument to ":embed" in order to view it offline (screenshot attached). However, I got an error "UndefVarError: savehtml not defined". Can anyone tell me what may cause this problem?
FYI, the "savefig" function can save the plot into an HTML but the HTML cannot be viewed on other machines.
It is also acceptable if there is another way to save an HTML plot that can be assessed from other machines. The interactive plot is generated by PlotlyJS.jl.
Thanks very much in advance.
This creates a standalone file that can be used on other machines.
However, those other machines need to have access to the internet:
p = PlotlyJS.Plot(sin.(1:0.1:10))
open("f.html","w") do f
PlotlyJS.PlotlyBase.to_html(f, p; include_plotlyjs="cdn", full_html=true)
end
I just checked that this is as far as you can do as of today (version v0.8.18) as there is a bug in the source code of PlotlyBase.

How to download an older version of PyTorch Geometric in Google Colab?

Question: How can I download an older version of PyTorch geometric in google colab?
Context: I am trying to use/load a pytorch-geometric graph and am getting the error message: "RuntimeError: The 'data' object was created by an older version of PyG. If this error occurred while loading an already existing dataset, remove the 'processed/' directory in the dataset's root folder and try again." This graph was generated during summer 2021.
I am using PyTorch and the following code to import Pytorch geometric, but am still getting the error when using older versions.
#import torch
!pip install torch==1.8.0
import torch
torch.__version__
!pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.8.0+cpu.html
I am not sure whether I am using the correct older version of pytorch-geometric (I don't really know how to check whether this is correct). Any insight to would be greatly appreciated:
How to download older version of pytorch geometric?
What is causing this error?
Thanks in advance.
You may not need to downgrade: If G is a graph data object giving this error you can simply convert it as follows.
from torch_geometric.data import Data
G = Data(**G.__dict__)
I'm not sure if you still need it but I just ran into the same problem and here's what I found:
It seems like there isn't a compatibility document but you can check the version history here and find the corresponding release for the one nearest to the time when your pytorch version was released, of course this doesn't guarantee compatibility but I think you have a pretty good chance?
For the additional packages e.g. torch-scatter, you can find the corresponding versions here and install from the .whl files.

How to enable autocomplete for Google Apps Script in locally-installed IDE

I'm trying to build GAS projects locally using clasp.
Any locally-installed IDE is a huge improvement over Google's Script Editor, so the tool looks very promising. Unfortunately, the autocomplete feature for GAS services doesn't seem to be included in the package.
The documentation says:
The Apps Script CLI uses TypeScript to provide autocompletion and linting when developing. Use an IDE like Visual Studio Code for TypeScript autocompletion.
After going through the steps and installing all required dependencies, I'm still unable to get the autocomplete feature to work. When I execute the clasp pull command for the existing project, it converts the ".gs" extension to ".js". The autocomplete suggestions are simply the result of parsing existing code.
For example, if I call sheet.getRange() somewhere in my code, then the getRange() method will pop up in suggestions, but I can't list available options for, say, PropertiesService, unless it's already used in my code.
Has anybody had any luck with enabling autocomplete feature for Google Apps Script?
I found the solution that partially works, but it may not be applicable to other software. The steps below are for Visual Studio Code:
Install the NPM package containing type definitions for GAS using
https://www.npmjs.com/package/#types/google-apps-script
In your locally-saved script, create a '.js' file and type
import 'google-apps-script';
This answer is a minor variation on the accepted one for IDEs/extensions which support Typescript auto completion based on tsc/tsserver:
Install TypeScript and #types/google-apps-script
https://www.npmjs.com/package/typescript
https://www.npmjs.com/package/#types/google-apps-script
Create a jsconfig.json file in your local project directory:
{
"compilerOptions": {
"checkJs": true
}
}
Alternatively, If you're using typescript along with javascript, then create a tsconfig.json:
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"types": ["google-apps-script"]
}
}
Include both filenames in .claspignore, if you're using clasp and if the file is in your local directory.
You can also use any of this config globally, if the config is in your home/parent directory, as tsc searches for this config from project/local folder to root(in which case, you don't need to include it in .claspignore).
If you are using any JetBrains IDE:
Go to Languages & Frameworks -> JavaScript -> Libraries -> Download... and download the library google-apps-script.
Try including the file name, import.js in .claspignore (docs).
This should save some trouble deleting the file before each push every time.
This is an answer provided by Google developers in the "TU17: Enhancing the Google Apps Script Developer Experience with clasp and TypeScript" video.
Add a JavaScript file to your project like "appscript.js" and, in that file, add:
import "google-apps-script";
Save that file but make sure to ignore it when pushing files back to your project using a .claspignore file.

NVP TransactionProcessorWse could not found

I am using a cybersource web service (http://www.cybersource.com/developers/).I am using simple order api.I have installed that software and wse 3.0.But in their sample project, i am getting error like (The type or namespace name 'TransactionProcessorWse' could not be found)
Please help me, i have been trying to find a solution since yesterday.
You need to download the Clients Solution from here:
http://www.cybersource.com/developers/develop/integration_methods/simple_order_and_soap_toolkit_api/dot_net_2_0/
the zip file is called simapi-net-2.0-5.0.2.msi Once you download, unzip, and run the installer. The files should be located under Program Files (x68)/CyberSourceCorporation/simapi-net-2.0-5.0.2 folder.
Go then to the "lib" folder where you will find the CyberSource.Clients.dll, as well as all the other dll's needed, and import them into your solution.
CyberSource.Clients.dll has the TransactionProcessorWse client.
Good luck

Boost Library Import Into Metatrader (MT4) Script File

I am working within a Metatrader script file and need to call a function within a Boost library. Anyone know if this is possible? If so how do you configure the import?
This is possible.
Check this out: http://docs.mql4.com/basis/preprosessor/import
If you look at most metaquotes mql examples, they import stdlib and stderror . The built in help section in the editor will also have info on how to do this.
Yes, it is really possible.
But all is not as you might imagine.
Of course, it depends on what you want to do, but main idea is to create a DLL and include it to your EA as Dmitry said.
All your functions must be defined like this:
extern "C" __declspec(dllexport) int doSomething(...)
{ ... }
So you may call it from your terminal.
Be careful with c++ types in Metatrader.
In a DLL you can do what you want according to your declaration -- with all data you'll get.
Don't forgot to check your DLL for dependencies (using Dependency Walker) to see what other DLLs your library is using (you must provide them to your Metatrader terminal, copy to terminal.exe location folder, or add folder with your DLLs to your systems path).