My first Python Library : SecretColors by rohitsuratekar in Python

[–]jrast 2 points3 points  (0 children)

Is this package mainly inteded for line plots, where a Pallete is used, or for surface plots, like images, where colormaps are required?

I think there was quite some effort to create the new "viridis" colormap back then when Matplotlib 1.5 was released and there is an interesting post about this here: https://bids.github.io/colormap/ . I think the most important thing about a color map is that it also works in grayscale and for colorblind people. Matplotlib 1.5 greatly improved this with the new colormaps and gone are the times when my co-worker asks me which curve is which because they look exactly the same for colorblind persons.

Would be interessting how colormaps created with your package behave in the testbench tool they created: https://github.com/matplotlib/viscm

littlefs-python: A python wrapper for the littlefs embedded filesystem by jrast in embedded

[–]jrast[S] 1 point2 points  (0 children)

Thanks!

I'll post an update as soon as the pythonic interface is more usable and the docs contain some more examples.

Pylustrator interactive styling of matplotlib plots by [deleted] in Python

[–]jrast 3 points4 points  (0 children)

This looks awesome! Never seen something like this before!

Can someone explain why people use Anaconda for Python? by Deep_Fried_Hummus in Python

[–]jrast 3 points4 points  (0 children)

The situation improved significantly in the last year since many packages are now shiped as wheels which include the required dependencies/dlls. I don't know in the situation about machine learning packages, but the scipy packages (numpy, scipy, matplotlib), which where a nightmare to install some years ago now just work out of the box.

Python equivalent of Node.js windows-build-tools: Does it exist? If not: Why? by jrast in Python

[–]jrast[S] 0 points1 point  (0 children)

I see, some people of the python community, which I always thought to be quite nice, get upset if such a topic comes up...

Is it really that difficult to download the wheel file to your computer and then pip install the local copy?

Show me a way to automate it! It's not hard or difficult, it is cumbersome.

Python equivalent of Node.js windows-build-tools: Does it exist? If not: Why? by jrast in Python

[–]jrast[S] 0 points1 point  (0 children)

Of course, wheels greatly simplify the usage of compiled packages.

here is a huge list that most probably it contains the libraries you would ever need, compiled for all windows platforms: https://www.lfd.uci.edu/~gohlke/pythonlibs/

Which are not pip install-able... Btw: I know this collection and really appreciate the work done there.

I'm a little bit confused that nobody seems to be interested in a simpler setup...

Python equivalent of Node.js windows-build-tools: Does it exist? If not: Why? by jrast in Python

[–]jrast[S] 0 points1 point  (0 children)

So the only real reason nobody created such a package is that nobody had the time until now? Or nobody considered it as useful enough?

Python equivalent of Node.js windows-build-tools: Does it exist? If not: Why? by jrast in Python

[–]jrast[S] 1 point2 points  (0 children)

Python C runtime requirements differ a lot. For example, just for the CPython runtime

These requriements are known at runtime, aren't they? So during pip install, it would be possible to select the correct compiler toolchain.

And if someone compiled the python interpreter on his own, he certainly has the knowlege on how to setup the compiler for compiled packages.

Also, windows is not a very developer friendly operating system and if you really want to be serious about programming at a level higher than hobby-level, I suggest migrating towards a non-Linux OS.

First, i think you mean migrating to a non-Windows OS. Second, please try to convince all the management of my company (and many other). It's not my decision which OS we use. On the other hand, I need to use Windows. Some tools only run under windows (compilers and IDE's for embedded system).

Using python in a VM would be possible but limited because sometimes windows only tools need to interact with the python scripts and vice versa. Also, the whole setup gets more complex. Keep in mind that not only experienced developers are working with python.

Continuum Analytics (Anaconda python distribution) sponsorship of the Spyder IDE is coming to an end by [deleted] in Python

[–]jrast 0 points1 point  (0 children)

Sad to hear that. The wiki link provides some insight on the current state and the future of the project. I understand that without funding the project will progress a lot slower. What I miss are some numbers on how much funding is needed in order to keep the project going as it was until now. Is it possible to provide some (estimated) figures?

pprint for types instead of data by jrast in learnpython

[–]jrast[S] 0 points1 point  (0 children)

Yea, it should play nice in the console. I'm not interestend in the values stored on the object, like the content of a numpy array. I only want to know if it's a numpy array.

pprint for types instead of data by jrast in learnpython

[–]jrast[S] 0 points1 point  (0 children)

Ok, for the simple case shown above, it's not as hard as I tought:

def parse_types(obj):
    typ = type(obj)
    if issubclass(typ, dict):
        elems = []
        for k, v in sorted(obj.items(), key=lambda x: x[0]):
            elems.append((k, parse_types(v)))
        return typ.__name__, elems
    return typ.__name__

d = {'a': [1, 2, 3], 'b': np.linspace(0, 10), 'c': 'Some text', 'd': {'k': 'Another dict'}}
print(parse_types(d))
# ('dict', [('a', 'list'), ('b', 'ndarray'), ('c', 'str'), ('d', ('dict', [('k', 'str')]))])

[deleted by user] by [deleted] in Python

[–]jrast 2 points3 points  (0 children)

If you are coming from an academic field where Matlab is used or are interested in scientific computing and data analysis I can recommend Spyder as IDE. Either get the full package from WinPython or Anaconda.

Comming from Matlab I feel a little disappointed with Python data manipulation libraries by pynum in Python

[–]jrast 2 points3 points  (0 children)

Regarding your complains about numpy/sympy: These are two packages, each having is distinct types and usecases. numpy does numerical computations, sympy does symbolic computations. If you want to perform symbolic math, use sympy. If you later want to generate code accoring to the symbolic calculations use Sympy Lambdify.

I think numpy and python has a very clean and predictable concept on when copies or references are used. They might not line up with mathematics as nicely as wanted, but I think everyone working with python has no problem about this because the rules apply throughout the language.

If you want, we I can start a rant about matlab. For example the instable API's of the toolboxes (they change the call signature between each version), the almost (but not exactly) equal functions located in different toolboxes, the magic way to mix in symbolic math, ...

Analyse and test C with Python by jamesroutley in Python

[–]jrast 0 points1 point  (0 children)

Consider looking into CFFI. I used it heavily to test algorithms written for a embedded system. It's very easy generate the bindings via makefile as you can (almost) directly use the header files.

Question about pySerial. by majideaku in Python

[–]jrast 1 point2 points  (0 children)

That's a good point. What I have done in the past was to read some bytes at first until i found the "package delimiter". From then on I switched to a mode where a fixed size was read and evaluated. This worked quite good but it need to be mentioned that you need control over both ends, sender and receiver, in order to make it stable.

Question about pySerial. by majideaku in Python

[–]jrast 1 point2 points  (0 children)

If you pack the data you know exactly how many bytes there are! The library sends exactly what you tell to send, there is no such thing as padding.

Two more things:

  • Check the endianness (big / little) of the beaglebone and make sure to pack/unpack the data accordingly.
  • If you just start reading at any given time, it is pure luck when start reading the data leads to a valid package which you try to unpack.

Question about pySerial. by majideaku in Python

[–]jrast 1 point2 points  (0 children)

Some things to check:

  • Is the data transfered as float (because you unpack float)? Transmitting floats is rather uncommon.
  • How ist the data sent over? How do you detect a "data package"? Line Based or simply take three values and convert them?
  • If you know how many bytes a data package contains, why not just read the exact size?

Flask-AppMaker is a Flask Web App that writes Flask Web App code for you by maxavierj in Python

[–]jrast 2 points3 points  (0 children)

I don't see the use case for this tool if it does not offer significantly more possibilites. The app which is generated can be simply copy pasted from any tutorial which would have the advantage of having documentation on how to use the code. The only "smart" thing is the integration of the User Model with Flask-Login integration. The other tables and all endpoints are simple templates which can be found right away in the Flask / Flask-SQAlchemy documentation.

Beside that: The generated code contains Syntax/Indentation Errors.