Python interface

425 views
Skip to first unread message

Gaspard

unread,
May 16, 2016, 6:37:08 AM5/16/16
to fityk-users

Hi everybody,

 

I’m now a happy user of the 1.3 version. I plan to use the python interface (windows 7). I have tried many manipulations. I have installed different python builds (2.7, 3.4, x86, x64), I have placed libfityk-4 in dlls  or lib/site-packages directories of python. The script “hello.py” (downloaded from github) gives always the same error


from fityk import Fityk

ImportError: No module named fityk

 

Could you give me some information and examples to bind libfityk to python language?


Thank you,


Marcin Wojdyr

unread,
May 16, 2016, 9:52:27 PM5/16/16
to fityk...@googlegroups.com
Hi Gaspard,
python bindings are not included in any binaries. On Windows they
would be _fityk.pyd and fityk.py files.
I suppose the best way to distribute python bindings would be through
pypi. I'm looking now how it could be done.

Marcin
> --
> http://groups.google.com/group/fityk-users
> ---
> You received this message because you are subscribed to the Google Groups
> "fityk-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fityk-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

djpe...@ncsu.edu

unread,
Jan 24, 2017, 5:04:23 PM1/24/17
to fityk-users
Hi Marcin,

Has there been any update on this? I'm trying to do the same thing in ubuntu but I think I'm having trouble creating the python bindings correctly. 

Thanks,
Dave

Marcin Wojdyr

unread,
Jan 24, 2017, 9:32:59 PM1/24/17
to fityk...@googlegroups.com
Hi Dave,

a few days ago I made new packages for Linux that work with Anaconda Python.
Details are here:
https://github.com/wojdyr/fityk/wiki/Conda-Channel
I think that's now the easiest way of installing fityk with python bindings.
For now it's only for Linux. I'll try to add Windows packages next,
but I don't know when I'll manage to do it.

Originally, when I got that email in May, I was planning to add fityk
bindings to PyPI. I started by adding xylib to PyPI:
https://pypi.python.org/pypi/xylib-py/
but than I gave up. Fityk has more dependencies and it'd not be easy
to package it in pythonic way.
But it's relatively easy to make conda packages that work with Anaconda.

Marcin

Alexander Selyutin

unread,
Jan 25, 2017, 4:30:45 AM1/25/17
to fityk...@googlegroups.com
It will be great if fityk will has pre build with python interface!


--
Regards,
Alexander Selyutin

Marcin Wojdyr

unread,
Feb 9, 2017, 10:10:26 PM2/9/17
to fityk...@googlegroups.com
It's been a while, but finally the Windows binaries of python module are ready.
This is about python bindings to libfityk and presumably few people
are interested.

The python extensions are built on AppVeyor, which is a Windows-based
continuous integration service.
Two builds are run after every change in the source code:
- one with Visual Studio 9 2008 that builds 32-bit extension for Python2.7
- the other with Visual Studio 14 2015 - it builds extension for
64-bit Python3.5

To download them go to https://ci.appveyor.com/project/wojdyr/fityk
click the corresponding job name, then click ARTIFACTS and download
the zip file.

The extension is in a directory pythonX.X. It depends on DLLs from
bin/, so it may be easiest to move files from both directories to the
same one.

I've just set it up and haven't had a chance to test it yet (I'm
writing it on Linux). It should work, but if it doesn't - let me know.

Marcin

mathias mammen

unread,
Sep 13, 2021, 10:08:39 AM9/13/21
to fityk-users
Dear Marcin 

I know this thread is rather old  - however if you see this could you possible upload the python ectensions again? 
It seems like that AppVeyor only stores it for a month 
thanks in advance 

best Mathias

Marcin Wojdyr

unread,
Sep 18, 2021, 12:23:44 PM9/18/21
to fityk...@googlegroups.com
Hi Mathias,
I did rerun AppVeyor job - the zip file is there again.
Best,
Marcin

m.pe...@gmail.com

unread,
Oct 1, 2021, 9:33:16 AM10/1/21
to fityk-users
I am using python for my data processing and i was planning to use lmfit library to fit my data, but then i realized fityk has everything i needed and for initial tweaking it is really great. But as lmfit provides many examples, fityk is weaker in this.
Does anybody have functional recipies how to use it in python environment. From importing fytik into python to opening dataset, doing bkg subtraction and then fitting peaks, extracting results storing them back to dataframe or matrix?
Reply all
Reply to author
Forward
0 new messages