« first day (2824 days earlier)      last day (2127 days later) » 

9:14 PM
still not too late to read about python basics as I already suggested today
 
@AndrasDeak my point was from module import * would save more characters from having to be typed.
 
except one should never do that with third-party modules
star imports are imperatively bad form in general
 
import * does reduce the number of characters used on import. I wonder how many get used in debugging print() etc. when it all goes wrong?
 
@AndrasDeak why so? is it because everything from the library will come with it? then, again, cherry picking out what's needed would still be better than aliasing. You wouldn't have to dot anything.
 
Off the top of my head, from numpy import * causes a lot of problems with numpy.any and numpy.all shadowing any and all.
open is also a frequent source of problems. Lots of modules have an open.
 
9:21 PM
@MisterGeeky yes, pollutes the namespace for no good reason. Cherry-picking can be fine but as it is written, namespaces are one honking great idea.
 
>>> set(dir(numpy)) & set(dir(__builtins__))
{'bool', '__spec__', 'min', 'complex', 'float', 'all', 'sum', '__doc__', 'abs', 'max', '__name__', 'str', '__loader__', 'divmod', '__package__', 'object', 'int', 'any', 'round'}
 
float, int, str and bool are probably the same thing
You seem to want to solve the problem of using np.array rather than array but the vast majority of people don't see that as a problem to begin with.
 
>>> {k for k in dir(numpy) if hasattr(__builtins__, k) and getattr(__builtins__, k) is not getattr(numpy, k)}
{'__spec__', 'all', '__package__', 'any', '__name__', 'max', 'min', 'abs', 'divmod', 'round', '__loader__', 'sum', '__doc__'}
 
there was a module in matplotlib called pylab which contained numpy and pyplot (with a bunch of submodule names too) in a huge namespace; it was eventually deprecated because it was too clumsy and not useful enough
at least I think it's de facto deprecated at least
 
As far as I have read, that is correct.
 
9:26 PM
the only reason I'm a bit insure is that pylab is still there and the module-level docstring doesn't mention deprecation (I'm too lazy to look at the online docs)
 
with open('./tmp/output.json', "w") as outfile:
    subprocess.call(command, stdout=outfile)
 
I think it's a bit like matrix in np. It's just left in a stagnant state but not given a deprecation warning
 
If I run that from within flask
What will the current directory be?
 
Unless that was actually deprecated in np. I haven't checked that either actually, but never used it :)
 
well at least with matrix I know it's only sort of deprecated and a lot of people still use it and rely on it
 
9:27 PM
I am getting FileNotFoundError: [Errno 2] No such file or directory: './tmp/output.json'
 
@Johnston I suspect that has nothing to do with the subprocess call
I'll go out on a limb and say that the file is not there
 
@AndrasDeak That was also my conclusion
 
"there" being the cwd for when you run flask; there's probably an os.cwd() os.getcwd()
 
The file would be created because it's in w mode? It's the directory that doesn't exist?
 
@AndrasDeak probably not the directory that the open call is in right?
 
9:29 PM
@roganjosh ah, good point
missing permissions?
 
Would perms show a different error?
 
not necessarily
 
You need to get Flask to print the cwd
 
yup
 
There are several ways to structure a flask app
 
9:30 PM
and possibly its permissions
 
So off the top of my head I couldn't tell you exactly how to fix the path
 
I'd first check if they need to fix the permissions
 
Ah. Got it. Thanks folks.
For some reason if I ping this group my long standing issues get solved
 
"The productive programming cabbage."
 
It was not a permissions issues. The directory did not exist in that directory I was running flask in. which is in an api directory of the larger app.
 
9:33 PM
good, good
 
For some reason I was thinking the /tmp directory would be in the route of the larger project, which was a dumb assumption,
 
It's not a dumb assumption
 
any bug-related assumption seems dumb in hindsight
 
Especially with blueprints it can make it tricky to understand exactly how to get relative file paths
 
Where the people get these questions?
 
9:37 PM
Thanks @AndrasDeak and @roganjosh
 
what's the best response to "now, you're just somebody that I used to know"?
 
python has too many annoyingly named builtins. Trying to avoid shadowing stuff leads to annoying code like image.save(format_='png', file_=open('foo','wb')) :/
 
@Aran-Fey I'd rather change the keyword
plus file is not a built-in ;)
 
@MisterGeeky I think someone wrote a whole song about that
 
@MisterGeeky "but you didn't have to cut me off"?
 
9:47 PM
@roganjosh no, I'm the one who ghosted. So, that lyric won't work for me.
 
@AndrasDeak it is in pythoff, so it still kinda counts
 
meh
 
I have absolutely no idea what we're talking about, but there is indeed a song full of lyrics to use and I'm not going to go through all the lines
 
@AndrejKesely I have tried and failed to figure out where that data is coming from, but I can tell you that 75 is ascii 'K' and the German word for calendar starts with K and everything after '75=' is a date.
 
9:49 PM
@AndrasDeak okie dokie.
 
@MoxieBall Could be some data from embedded device
 
I need data on the weight and wingspan of emperor and lunar moths. Know where I can get that?
It's to do svm classification.
 
What does that have to do with Python and why would we know this? I'd say that qualifies as niche knowledge.
 
That doesn't seem to have to do with Python or cabbage, so it's outside of our wheelhouse.
 
ooh, there's stats SE. I'll check there.
Toodles, guys.
thanks for all the help.
see ya
 
10:03 PM
stats SE isn't a repository of random measurements
 
@abarnert I didn't know you did C. Thank you in any case :)
 
@roganjosh ssssssh
 
I was torn about saying anything, apologies :P
 
@MisterGeeky I think you're going to be disappointed by the number of people who think it's useful to weigh moths
 
hmm, I wouldn't bet on that
 
10:08 PM
I wouldn't either
 
They fly, so you'd probably have to sedate them
"How to make moth unconscious" is definitely one of the weirder things I've googled
I imagine moth sedatives are an underdeveloped area
 
everything is a horse
 
Or just use a big net, stick a pin through their abdomen and put them in a glass cabinet
 
but really, I suspect most insects can be incapacitated in the same way
plus what roganjosh said; most insects are so numerous that killing a dozen in the name of science won't be a problem
 
My uneducated guess is that any amount of horse tranquilizer would be catastrophic to a moth
Also true, you could just sacrifice a bunch of them. Still, I think it's an unpopular enough area of study that you're gonna have a tough time finding people to share their moth weight databases with you
or, what I really mean is, I couldn't find anything in a google search for "moth weight statistics" and anything more than that is too much effort
 
10:14 PM
... I don't want to actually have to research this, but I think you'd be surprised
 
I'm actually surprised at how little I have been able to find, but you should definitely spare yourself
 
@MoxieBall incorrect
there's a continuous range of dosages between "homeopathy" and "horse"
 
And insect metabolism is completely different. I don't know if you guys are having a serious conversation...
 
Moths are basically butterflies, very mainstream entomology. I don't see why you think it's such an esoteric thing to research. The issue is that people weighing moths are more likely to publish their findings in papers which are less likely to be indexed by google. Try some entomological journals
 
For example, permethrin will knock out an insect in seconds but we can breathe it just fine (like, in reasonable doses)
 
10:17 PM
@roganjosh I'm pretty sure chloroform-level stuff work fine on anything
 
How a moth would metabolize horse tranquilizer is so far outside of my realm of knowledge that I cannot claim to be having a serious conversation
 
@roganjosh sure, and some dog spot-on insecticides kill cats
 
Because it contains permethrin
and cats can't metabolise permethrin and its analogues
 
@MoxieBall my point is that "any amount [...] would be catastrophic" cannot be true :P
 
Yes, that is true lol
 
10:19 PM
whether or not there's a dosage where the insect gets reversibly knocked out is another matter
perhaps it's as simple as drowning them in ethanol or CO2 for a bit
 
But these things are only toxic if they can interfere with biological pathways
 
I'd expect "knocking out insects safely" is much less studied than "measuring insects", because you can do the latter just fine with dead specimen
 
And if the chemistry of some biological pathway is different... well there's no reason to assume that a sensible dose would affect some other creature
And by sensible, I mean you could kill any land-based animal by submerging them in water for long enough, even though water is essential for life.
 
that murderous dihydrogen-oxide
 
The oxford journal of insect science only has 5 articles on Actias luna, and none of them are about weight... And I think that even if there was an article in a journal about moth population weight statistics, it would probably be "The effect of X on ...", which would probably have a control group but I'm not sure if it would be useful for svm stuff
 
10:22 PM
prime item on my list of "essential for life yet deadly" things is oxygen
 
I find it ironic that I am caring about moths this much while arguing that nobody cares this much about moths
 
free radicals!
I think I want a shirt with that printed on it
 
rbrb, time to fly toward the light...
 
rhubarb here too, talk about herpetology just to turn the topic back to python
 
night guys, I'll be heading out shortly too
 

« first day (2824 days earlier)      last day (2127 days later) »