Comments (6)
Hi,
Actually, my mistake the methods do work, what doesn't work is ipython's autocomplete, which only shows the non-auto-generated functions.
Ed
from pyvips.
Hello, the autogenerated method docs are generated for sphinx by this:
https://github.com/jcupitt/pyvips/blob/master/pyvips/voperation.py#L453
pyvips tries to help things like ipython autocomplete by adding help messages for the autogen methods. For example:
$ python
Python 2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
>>> help(pyvips.Image.black)
Help on function call_function in module pyvips.vimage:
call_function(*args, **kwargs)
Make a black image.
Example:
out = pyvips.Image.black(width, height, bands = int)
Returns:
out (Image): Output image
Args:
width (int): Image width in pixels
height (int): Image height in pixels
Keyword args:
bands (int): Number of bands in image
Raises:
:class:`.Error`
>>>
which is made by this:
https://github.com/jcupitt/pyvips/blob/master/pyvips/voperation.py#L252
It works for members too, for example:
>>> x = pyvips.Image.new_from_file("/data/john/pics/k2.jpg")
>>> help(x.black)
... same as above
I don't know much about ipython. What would need to happen to fix the autocomplete?
from pyvips.
Hi,
Sorry, my knowledge is pretty limited with this kind of thing.
I see what you mean, indeed the help works. Though dir(pyvips.Image) doesn't show all the functions.
When I used "from gi.repository import Vips" I could find everything and when I looked at pyvips I couldn't. I assumed the library wasn't finding the .so correctly, so reinstalled in a couple of different ways. Probably worth highlighting this somehow to make sure it doesn't happen to others.
Ed
from pyvips.
There are two Python bindings. libvips comes with one based on pygobject, which has a range of annoying problems. That's the one you get with from gi.repository import Vips
.
pyvips is a new one based on ffi which is much better. That's the one you install with pip.
Anyway, install with pip and just use import pyvips
to get the new one.
from pyvips.
dir()
will only show real methods. pyvips uses __getattr__
to detect the use of missing methods and look them up in libvips instead, so dir()
won't work.
from pyvips.
Thanks, it all seems to work well.
Ed
from pyvips.
Related Issues (20)
- new release when & ship with libvips? HOT 14
- ICC Profile Application on SVS and tiffsave hangs randomly
- High RAM usage with fetch when reading multiple WSI tiles HOT 2
- Slower first run, even without cache HOT 2
- using resource.setrlimit makes pyvips / liborc spit the dummy HOT 2
- Memory leaking with pdf HOT 21
- dzsave_target returns NoneType not list[] as in docs HOT 1
- Pyvips fetch returns bad image on .svs files HOT 4
- Reading in image a second time breaks on qptiff file HOT 6
- Documentation link to conda package HOT 1
- Create svs file with image pyramid, label and macro in pyvips? HOT 4
- Image merge stitch HOT 2
- `addalpha` has different behaviour compared to C HOT 1
- Error installing pyvips on Mac OS HOT 15
- draw_rect fill error HOT 2
- creating tiles of 16bit multiband (4 band) tiff image leaves black canvas HOT 4
- class "jxlsave" not found HOT 9
- Assertion failed: sp->cinfo.comm.is_decompressor HOT 3
- Help installing pyvips for jupyter HOT 5
- `TIFFFillTile: Read error` when writing a TIFF file on a per-tile basis. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvips.