-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor/pyamapping #79
Conversation
e6357ea Doesn't look like it should be part of the PR. Can you double check and rebase your project. |
We should pin pyamapping rather than just acquiring whatever the latest, this can be dangerous down the road with breaking change. Also I check your pyamapping dependency requirements which has the same concern, I think you should also pin your numpy version. |
And my last comment is: |
306894f
to
f649da8
Compare
I rebased the PR and force pushed |
mapping is more general than just scaling, a mapping does not need to be invertible, in this sense a clipping is a mapping, as well as certain nonlinear distortions that are not monotonous. pyamapping should in future contain polynomial functions as well as mappings tailored to a given data distribution, e.g. using the cdf as mapping function. |
note that dbamp, midicps, etc remain possible abbreviations for the (now recommended and more pythonic named functions) db_to_amp and midi_to_cps(). In this sense some changes in pya are not strictly necessary. |
Thank you for your feedback.
The main purpose of pyamapping is to provide a home for all (audio related) functions that are shared between the interactive-sonification packages (pya, sc3nb, mesonic, sonecules). This is done to reduce code duplication and insure that the users always |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pin pyamapping rather than just acquiring whatever the latest, this can be dangerous down the road with breaking change.
It does not look like the versions are pinned (==) in a way that would prevent the installation of a newer i.e. scipy.
To my understanding you leave the version as unrestricted as possible as this eases the dependency solving process.
At least this should be the case if you are developing a library and not an end user application for a specific production environment.
Also, for a more detailed reasoning, see this stackoverflow question:
https://stackoverflow.com/questions/28509481/should-i-pin-my-python-dependencies-versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't and probably shouldn't pin it with ==, but we should provide at least a lower limit. And probably the next major release as the higher limit. Or else this will be dangerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same issue (a bigger one) in pyamapping as numpy is not pinned. We had to bump it in the past because there is already a breaking change in np.linspace if i remember correctly. So we should move away from some of the older numpy releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method name change (adding to) not mandatory but useful!
I understand this argument, but I would say in this case the naming of |
I approved the PR, But I would still recommend pinning numpy with a lowest version. |
Will do. I noticed that the pya dependency on numpy was removed by 47d0758 and currently it is only indirectly dependend on numpy because of scipy. Previously it was I also think it will be quite likely that in the future (perhaps 0.2.0 already) pyamapping will depend on scipy as well to more easily provide more functionalities as e.g. a data driven mapping. Additionally in the envisioned use cases of pyamapping it will be installed mostly together with pya and thus scipy anyway. So we could wait with this pull request until then. Regarding your previous comment on the name of pyamapping:
What would be your suggestions for a better name? Perhaps a better route alltogether would be to
pyaudio is to my knowledge only necessary for the PyAudioBackend for the Aserver and in our use cases we often use Asig instances for signal conditioning and plotting and do not need the Aserver/playback/record functionality. This would allow users interested in these use cases only to use pya without installing portaudio or am I mistaken? I added @aleneum as reviewer to see what his perspective on this is. But perhaps we should take this discussion elsewhere. |
I have no strong opinion on which minimum version of numpy to use. So I think your suggested version should be fine. I don't think we need to go way back. Let's stay modern to some extend. Secondly, yes, making pyaudio an optional dependency, similar to what |
f649da8
to
4c3bea6
Compare
Hello everyone, I am not really sure what I should review so I will just add my 50 cents after a brief scan of the conversation. Should functionality be ported into another package?If the new package will exclusively used by Make pyaudio optionalSince @dreinsch and @wiccy46 presented use cases where pyaudio is not needed I'd make it optional since it's rather tedious to deal with pyaudio, especially if you don't actually need it. Pinning versionsThere is a guy running around on Github named PyDeps who is (semi-)manually checking project dependencies for too loose or too strict dependencies and he has some valid points. I did a little research and I'd say that as mentioned by @wiccy46 there should be some reasonable version pinning established. We should not forget that a release cannot be undone! Cheers! |
We created a new package to share all mapping / conversion related functions in the interactive-sonification packages.
See https://github.com/interactive-sonification/pyamapping
This PR adapts the current code to work with pyamapping