astrogewgaw / fftfit Goto Github PK
View Code? Open in Web Editor NEWThe FFTFIT algorithm, in Python.
License: MIT License
The FFTFIT algorithm, in Python.
License: MIT License
fftfit
fails to install on my own machine, giving the following error:
pip
's output (click to collapse):Processing /run/media/ujjwal/codex/codes/python/fftfit
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/home/ujjwal/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/ujjwal/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/ujjwal/conda/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 483, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 1, in <module>
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/numpy/distutils/__init__.py", line 26, in <module>
from . import ccompiler
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/numpy/distutils/ccompiler.py", line 20, in <module>
from numpy.distutils import log
File "/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/numpy/distutils/log.py", line 4, in <module>
from distutils.log import Log as old_Log
ImportError: cannot import name 'Log' from 'distutils.log' (/tmp/pip-build-env-ufahow3h/overlay/lib/python3.9/site-packages/setuptools/_distutils/log.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
@astrogewgaw thanks for this work, it's extremely useful!
However, it is not working as expected, and fails in a seemingly simple case. Here is a minimal working example:
In [1]: from fftfit import fftfit
...: import numpy as np
...: import matplotlib.pyplot as plt
...: plt.ion()
...: template = 100 *(1 + 0.2 * np.sin(2 * np.pi * np.arange(0, 1, 0.001)))
...: prof = np.roll(np.random.poisson(template), 100)
...: plt.plot(prof, label="Profile"), plt.plot(template, label="Template")
...: plt.xlabel("Nbin")
...: plt.ylabel("Counts")
...: plt.legend()
...: fftfit(prof, template)
Out[11]: (0.0, 999.0, 0.0, 0.0, -inf, 0.0, 2)
Sometimes, it gives more reasonable numbers, but it mostly fails this way.
I'm on a Mac with M1max processor, Python 3.9, numpy 1.23.1
Hope this helps!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.