Giter VIP home page Giter VIP logo

Comments (10)

victorlei avatar victorlei commented on September 28, 2024

maybe you have an outdated version of networkx? Try:;

import networkx
networkx.version

What did you get?

from smop.

victorlei avatar victorlei commented on September 28, 2024

To simplify matters install once with easy_install -- it will bring current versions of everything.

easy_install --user smop

from smop.

sunbau avatar sunbau commented on September 28, 2024

Hi victorlei, thanks a lot for your quick reply. Here is what I got:

networkx.version
'0.37'

I don't have write access to the computer, so I will ask my administrator to install it. Thanks for your help!

from smop.

victorlei avatar victorlei commented on September 28, 2024

try

easy_install --user networkx

from smop.

victorlei avatar victorlei commented on September 28, 2024

this is a very old version. Current is 1.9.1

from smop.

sunbau avatar sunbau commented on September 28, 2024

Yes, many of my python modules are too old. Smop works well after the new versions were installed. Thanks victorlei.

from smop.

victorlei avatar victorlei commented on September 28, 2024

You are welcome. I am always curious what kind of code is converted using smop, so maybe you could post some of your code

from smop.

sunbau avatar sunbau commented on September 28, 2024

I want to convert a standard MATLAB function "imfindcircles" into python, not sure if it is right to post the code here because of the authorization issue, but the file imfindcircles.m can be found in the MATLAB directory if you have MATLAB installed.

Smop worked well with the example solver.m, but so far I have not converted imfindcircles.m successfully. There was no error message showed up, but the converted code was incorrect (looks like smop didn't walk into the MATLAB code). I am still checking to see if I can have this fixed.

Here is what I had:

Autogenerated with SMOP version

main.py /smop/CODE/imfindcircles.m -o /smop/CODE/imfindcircles.py

from future import division
from runtime import *

Thanks!

from smop.

victorlei avatar victorlei commented on September 28, 2024

Are you sure that m file is not empty?

from smop.

sunbau avatar sunbau commented on September 28, 2024

Hi victorlei. Yes, the .m file is not empty, it is a standard MATLAB function with 303 lines.
It is very interesting that the problem seems to be solved by deleting the "end" at the end of the .m file
The original .m file looks like this:
function [output1, output2, output3] = function_name(inputs)

lines that do the job

end

I deleted the "end", then smop generated a .py file which was not empty. I haven't test the converted python code yet, but I think it should work with some modifications.
Thanks a lot for your work, it saves my time (otherwise will have to do it manually T_T). Very cool job!

from smop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.