Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start what's new for 1.0 #3704

Merged
merged 6 commits into from Jul 22, 2013
Merged

Start what's new for 1.0 #3704

merged 6 commits into from Jul 22, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented Jul 20, 2013

minor fixes along the way:

  • updates to tools/gh_api for getting the stats
  • raise AttributeError, not ImportError in ShimModule - the __import__ call will raise the ImportError if there should be one.

@Carreau
Copy link
Member

Carreau commented Jul 20, 2013

Btw, just before taking my flight. I think that github support uploads
again. They call it realeases IIRC.

Le samedi 20 juillet 2013, Min RK a écrit :

minor fixes along the way:

  • updates to tools/gh_api for getting the stats
  • raise AttributeError, not ImportError in ShimModule - the __import__call will raise the ImportError if there should be one.

You can merge this Pull Request by running

git pull https://github.com/minrk/ipython whatsnew

Or view, comment on, or merge it at:

#3704
Commit Summary

  • add auth and paged request to gh_api
  • checkpoint
  • raise AttributeError on missing attribute in ShimModule
  • updates to github stats
  • start 1.0 whatsnew

File Changes

Patch Links:

@minrk
Copy link
Member Author

minrk commented Jul 20, 2013

That's true, I will look at what's involved.


Which is a *library* function for getting the current IPython instance,
and will return ``None`` if no IPython instance is running.
This is the official way to check whether your code is called from inside an IPython session.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that in many cases, people might not want to import IPython to test whether their code is running in an IPython session. Do we have a convenient and official way to do that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the current de facto standard is

try:
    ip = get_ipython()
except NameError:
    ip = None

But this is only true for code called from within the builtins_trap, which we found can be not true in some cases, such as when loading extensions at startup, etc.

How else can we provide a function for checking IPython, other than a function imported from IPython or injected into builtins?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that raises a more complex issue of exactly what we mean by code 'running in IPython'. But if that's a common case, one obvious approach would be to set a builtin, or some other globally accessible variable, all the time that IPython is running.

Alternatively, we could provide a function to copy&paste that checks whether IPython is in sys.modules, and only calls IPython.get_ipython() if it is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's appropriate. I guess the function would be:

def get_ipython():
    import sys
    if 'IPython' in sys.modules:
        import IPython
        return IPython.get_ipython()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

minrk added a commit that referenced this pull request Jul 22, 2013
@minrk minrk merged commit 0df3fbd into ipython:master Jul 22, 2013
@minrk minrk deleted the whatsnew branch July 22, 2013 00:51
@dpsanders
Copy link
Contributor

@minrk Update nbconvert syntax:

Line 157:

ipython nbconvert --format full_html *.ipynb

ipython nbconvert --to html *.ipynb

Line 186:

simply set InlineBackend.figure_format = 'retina' for 2x PNG figures.

Replace with:

simply use %config InlineBackend.figure_format = 'retina' for 2x PNG figures.

@Carreau
Copy link
Member

Carreau commented Aug 5, 2013

Replace with:
simply use %config InlineBackend.figure_format = 'retina' for 2x PNG figures.

Disagree, set is more general, you can do it in your config file, or at the command line. %config does not persist (yet)

@dpsanders
Copy link
Contributor

You are of course correct; my point is that how is somebody supposed to
know how to do any of these things? At least I gave one concrete way to do
it.

I guess alternatively we could just put a link to the config docs.
Perhaps a more narrative introduction should be in notebook.rst, rather
than just a link?

On Mon, Aug 5, 2013 at 2:29 AM, Matthias Bussonnier <
notifications@github.com> wrote:

Replace with:
simply use %config InlineBackend.figure_format = 'retina' for 2x PNG
figures.

Disagree, set is more general, you can do it in your config file, or at
the command line. %config does not persist (yet)


Reply to this email directly or view it on GitHubhttps://github.com//pull/3704#issuecomment-22090805
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@Carreau
Copy link
Member

Carreau commented Aug 5, 2013

You are of course correct; my point is that how is somebody supposed to
know how to do any of these things? At least I gave one concrete way to do
it.

There is always a delicate balance between saying too much and too little.Here we jus inform people with retina-display that they can enable it. They are probably a minority, and I don't think it is worth giving more info. If you give too much info or one-liner on how to do something then people don't learn. Using the word "set" implicitly state that you have to configure something, so you look for configuration. Once you know our configuration system then you know how to configure everything else. So it is small difficulty for the user, but he will gain a lot by surpassing it, it will also remove us the pain of describing on every configuration option in all the doc how to configure.

As for %config, not everything can be changed at load time with %config , so it can confuse user.

Still it is true that the config docs might be a little too much for a new user and we should probably have a simple introduction doc just about config files and how to write them.

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants