Comments (9)
@advilbn Yes, I am aware functools.wraps
forwards function attributes such as name and docstrings. As mentioned, jit
being the identity doesn't suffer from those problems, there isn't a wrapper to begin with. For example
def jit(func=None, *args, **kwargs):
if func is None:
return lambda x: x
else:
return func
@jit
def f():
"""docstring f"""
@jit(nopython=True)
def g():
"""docstring g"""
print(f.__name__) # f
print(f.__doc__) # docstring f
print(g.__name__) # g
print(g.__doc__) # docstring g
If there are no other concerns, we will proceed as planned.
from libsvm.
@advilbn I am not a maintainer of this project, but I agree it should be yanked. As it stands, just importing the python code without numba
installed breaks.
Regarding the suggested code, I agree it looks better this way and will update it.
from libsvm.
@advilbn Version 3.33.0 has been yanked from PyPI, thanks for the reminder.
from libsvm.
You could also yank the current version 3.33.0 in pypi, that way no one would need to pin/exclude manually this version.
@nilfm99 , in your PR (#219), you could use a version of the decorator using, functools.wrapps
try:
from numba import jit
jit_enabled = True
except:
from functools import wraps as functools_wraps
def jit(_func=None, *args, **kwargs):
def decorator_jit(func):
@functools_wraps(func)
def wrapper_jit(*args, **kwargs):
return func(*args, **kwargs)
return wrapper_jit
return decorator_jit if _func is None else decorator_jit(_func)
jit_enabled = False
from libsvm.
from libsvm.
@cjlin1 , Could you also yanked the version 3.33.0 ? As i mentioned before this prevents users or automatic cicd pipelines to fail installing this version. Yanking gives time to not rush patching but providing a good user event/issue experience.
NoteL You could yank the package in the pypi website using you account.
Thank in advances, for all you help on this.
from libsvm.
@nilfm99 We are in the process of releasing 3.33.1, and we opted to use the original commit 8802a10 in your PR. functools.wraps
seems to be more complicated than necessary for our purpose because jit
is never going to be anything other than identity, which doesn't have issues with function attributes. Are there other concerns I missed?
from libsvm.
@Sinacam , please check functools.wraps
documentations, https://docs.python.org/3/library/functools.html#functools.wraps. Using it is more a technicality to avoid loosing the name and docstrings when using decorators. the documentation has an example, that illustrates it.
from libsvm.
@Sinacam , thanks for the explanation and your help on this. No concerns from my end.
from libsvm.
Related Issues (20)
- how can i improve train speed? HOT 1
- why my memory always HOT 1
- Some dataset problem HOT 2
- static library HOT 1
- gridregression.py
- LIBSVM library not found HOT 1
- gridregression.py 出现 RuntimeError: get no mse HOT 2
- Exception Thrown: read access violation HOT 1
- 使用svm-train.exe做回归(regression),参数c与g如何优化 HOT 1
- How to modify SVR loss function? HOT 1
- Accuracies lower than 50% if the random seed is unlucky HOT 8
- one class svm HOT 1
- Questions about the results of libSVM HOT 6
- Questions about probability estimation of one-class svm HOT 4
- 如何调整nu,使训练集的准确率增加? HOT 6
- cannot find -lgcc: No such file or directory HOT 1
- When using svm-scale , missing values come out. HOT 1
- Try using a custom objective function
- MATLAB Crashes when trying to run "svmtrain" on CentOS 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 libsvm.