question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove numpy from default PythonInterpreter and potentially introduce PythonNumpyInterpreter

See original GitHub issue

Right now only Python uses third party library (specifically numpy) for linear algebra. This is inconsistent with:

  • our mission “with zero dependencies”
  • other languages.

The first step was to drop numpy from cases without vectors, implemented in PR https://github.com/BayesWitnesses/m2cgen/pull/111 .

As the second step I want to suggest dropping numpy altogether from PythonInterpreter and potentially implement PythonNumpyInterpreter to use in cases where it would be beneficial.

As for the user API I see 2 options:

  1. Adding a new method export_to_python_with_numpy
  2. Adding a arameter with_numpy to an existing export_to_python method which would be False by default.

I personally think first option is better as users would have higher chances of noticing extra method than extra parameter with a default value.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
krinartcommented, Oct 26, 2019

My intuition was that one third-party library for linear algebra will be enough in any language

This is how assumptions work. They always seem to make sense until they don’t 😃

In general I always try to make as few assumptions as possible, as every assumption creates a dependency. In this case we would create an artificial dependency “Every language will have only one implementation with linear algebra library”. It seems like it makes sense (and it probably does), but why would we bring this unnecessary limitation?

Especially given that we are talking about our API, which should arguably be the most though-out component as that is exactly what users depend on and making backward incompatible changes in a well established API has never been an easy problem.

0reactions
izeigermancommented, Jul 28, 2020

@StrikerRUS Yeah, I agree. I see no benefits either. I think we should close this. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up and using your development environment - NumPy
When using pytest as a target (the default), you can match test names using python operators by passing the -k argument to pytest:....
Read more >
The m2cgen from BayesWitnesses - GithubHelp
Remove numpy from default PythonInterpreter and potentially introduce PythonNumpyInterpreter. Right now only Python uses third party library (specifically ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found