Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Cython -a flag (to generate yellow-shaded HTML) without command line
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
SteveB  
View profile  
 More options Jun 17 2012, 1:34 pm
From: SteveB <steven.byr...@gmail.com>
Date: Sun, 17 Jun 2012 10:34:52 -0700 (PDT)
Local: Sun, Jun 17 2012 1:34 pm
Subject: Cython -a flag (to generate yellow-shaded HTML) without command line

(copied from
http://stackoverflow.com/questions/11058933/cython-a-flag-to-generate...
)

When you run from the command prompt "cython -a ..." you get a really nice
HTML file with yellow shading to indicate slow python operations vs fast C
operations. You also get this same HTML file as a link every time you
compile Cython code in Sage. My questions are: (1) Can I get this HTML file
if I'm compiling using distutils? (2) Can I get this HTML file if I'm
compiling using pyximport? Thanks in advance!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Behnel  
View profile  
 More options Jun 17 2012, 1:45 pm
From: Stefan Behnel <stefan...@behnel.de>
Date: Sun, 17 Jun 2012 19:45:05 +0200
Local: Sun, Jun 17 2012 1:45 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line
SteveB, 17.06.2012 19:34:

> (copied from
> http://stackoverflow.com/questions/11058933/cython-a-flag-to-generate...
> )

> When you run from the command prompt "cython -a ..." you get a really nice
> HTML file with yellow shading to indicate slow python operations vs fast C
> operations. You also get this same HTML file as a link every time you
> compile Cython code in Sage. My questions are: (1) Can I get this HTML file
> if I'm compiling using distutils?

Yes, pass "annotate=True" into cythonize().

> (2) Can I get this HTML file if I'm
> compiling using pyximport? Thanks in advance!!

I don't think there's a direct option for that in pyximport, but you can
always import Cython yourself and set the option globally in the Options
module.

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bell  
View profile  
 More options Jun 17 2012, 2:41 pm
From: Ian Bell <ian.h.b...@gmail.com>
Date: Sun, 17 Jun 2012 11:41:43 -0700
Local: Sun, Jun 17 2012 2:41 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

Or if not using cythonize(), you can set the flag

Cython.Compiler.Options.annotate = True

which is not documented anywhere as far as I can see


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SteveB  
View profile  
 More options Jun 17 2012, 7:07 pm
From: SteveB <steven.byr...@gmail.com>
Date: Sun, 17 Jun 2012 16:07:32 -0700 (PDT)
Local: Sun, Jun 17 2012 7:07 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

Thanks! I put up those answers at stackoverflow in case anyone else is
searching for it.
http://stackoverflow.com/questions/11058933/cython-a-flag-to-generate...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Tyree  
View profile  
 More options Dec 5 2012, 2:01 pm
From: John Tyree <johnty...@gmail.com>
Date: Wed, 5 Dec 2012 11:01:19 -0800 (PST)
Local: Wed, Dec 5 2012 2:01 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

When I was digging through the source on Github, it seemed to me that you
should be able to pass cython_directives={"annontate": True} as kwarg in
Cython.distutils.Extension, but when I tried it it didn't work. Any
thoughts?

-John

Le dimanche 17 juin 2012 20:41:43 UTC+2, Ian Bell a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bradley Froehle  
View profile  
 More options Dec 6 2012, 12:26 pm
From: Bradley Froehle <brad.froe...@gmail.com>
Date: Thu, 6 Dec 2012 09:26:36 -0800 (PST)
Local: Thurs, Dec 6 2012 12:26 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

I've gotten it to work by using `ext_modules = cythonize(...,
annotate=True)` as shown on
 http://docs.cython.org/src/reference/compilation.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Tyree  
View profile  
 More options Dec 7 2012, 7:55 am
From: John Tyree <johnty...@gmail.com>
Date: Fri, 7 Dec 2012 04:55:32 -0800 (PST)
Local: Fri, Dec 7 2012 7:55 am
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

Yes that does work. I was just wondering about the Extension class
specifically. I suppose in the end it doesn't matter. I should probably
just use "cythonize" anyway.

Le jeudi 6 décembre 2012 18:26:36 UTC+1, Bradley Froehle a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bradley Froehle  
View profile  
 More options Dec 7 2012, 2:07 pm
From: Bradley Froehle <brad.froe...@gmail.com>
Date: Fri, 7 Dec 2012 11:07:19 -0800 (PST)
Local: Fri, Dec 7 2012 2:07 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

Fundamentally the distutils Extension class doesn't know anything about
Cython unless you use the Cython provided build_ext command.  I've found
its usually easier to use cythonize which processes the pyx source and
returns an Extension that distutils knows how to process.

Only drawback is that the pyx -> c conversion is run, even if you do
something like `python setup.py clean`.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bradshaw  
View profile  
 More options Dec 7 2012, 2:12 pm
From: Robert Bradshaw <rober...@gmail.com>
Date: Fri, 7 Dec 2012 11:12:23 -0800
Local: Fri, Dec 7 2012 2:12 pm
Subject: Re: [cython-users] Cython -a flag (to generate yellow-shaded HTML) without command line

On Fri, Dec 7, 2012 at 11:07 AM, Bradley Froehle <brad.froe...@gmail.com> wrote:
> Fundamentally the distutils Extension class doesn't know anything about
> Cython unless you use the Cython provided build_ext command.  I've found its
> usually easier to use cythonize which processes the pyx source and returns
> an Extension that distutils knows how to process.

> Only drawback is that the pyx -> c conversion is run, even if you do
> something like `python setup.py clean`.

A patch solving this issue would be very welcome! (I'm not sure the
best way to detect this...)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »