« first day (3276 days earlier)      last day (1686 days later) » 

12:00 AM
which is why I need the eight (x, y) pairs. This is one example dataset where I know the output from my R code differs from my current Python code and I'm trying to figure out why and how to replicate the "correct" values.
 
@Code-Apprentice Then it's possibly not even on-topic for Python. The standard unit-testing methodology to do ports is write yourself a bunch of unit-tests, from simple to complicated, then fix them one-by-one. Fix the ordinary case before the log-logistic case. Fix the p0 = (0, 0) case before the p0 = (-1, 1) case. Put in numerical tolerances on unit-testing numerical comparisons. etc.
 
There is only a log-logistic case.
 
At least plot the Python vs R curve-fits to sufficiently motivate Python users to believe that the error might be on the Python-side. And put those graphs above the code so they get seen. You're asking people's advice, that's my advice. Python users won't care if the error is anything caused by drc package, or its documentation.
@Code-Apprentice Ok. Can you also eliminate p0 = (0, 0)?
 
I actually have a complex scheme to estimate p0 which is irrelevant to the question.
I could add that but then the code is no longer "minimal"
p0 = (-1, 1) is sufficient for the purposes of the code example
 
Ok recommend you change the absolute first line of your question to "In the following code, the curve-fit in my Python version produces incorrect (slope, intercept) coeffts whereas the coeffts from the R version are correct." But I strongly suggest you post the plots of both graphs (on log-linear axes), to motivate the reader (then they can confirm at-a-glance that Python's wrong but R is right - which they currently totally can't). Otherwise they mightn't believe you the Python version's wrong.
...else people might (reasonably) suspect the issues could equally be in drc package. As someone jokingly remarked to me yesterday "Trust me, I'm a lawyer"
 
12:16 AM
yah, the question needs a stronger leadin, and a more direct question up front
and I could make the requirements more clear. It's not so much of an issue as the Python being "wrong" and the R being "right". The R code could certainly have a bug in it, but I still need to duplicate its output anyway.
 
@Code-Apprentice Appeal to our pro-Python jingoism (at least, don't make it sound like an appeal to Python developers to debug some R guy's long-dormant package which appears to have 0 unit-tests). Also, I searched a bit on Python numeric unittests, and you might find Automate your data analysis testing (Stephen Childs, PyCon Canada 2016) useful. Good luck, bye
 
@smci yah, I think my original question got lost in the weeds. Ultimately, I'm trying to find what technique the drc package is using for the regression. I think I finally found it as I dug past the data parsing (section a in your earlier comments) to the meat of the algorithm (section b). It calls a function named optim() that isn't doing least squares like the curve_fit() I'm using in the python code.
 
12:56 AM
@Code-Apprentice "Ultimately, I'm trying to find what technique the drc package is using for the regression." Well that was self-evidently never a Python question, so off-topic here and in [Python] tag. You should have asked Christian Witz, drc users and R biotech users on the mailing lists they use for that. Anyway I'm glad my tips on reading R functions helped you pinpoint it.
...I do encourage you to contact Christian Witz and see if he'd be interested in you submitting some code cleanup, real comment lines that explain what's going on (not dead code commented-out). Fail that, agitate (on the R biotech mailing lists) for some community ownership of drc code. Also, make sure your employer is more cautious in future to voluntarily accruing technical debt on a single-sourced, borderline-unsupported package.
Also, seems like your underlying issue has existing questions: Discrepancies between R optim vs Scipy optimize: Nelder-Mead
And I recommened you add a sprinkling of unittests to your Python port.
 
 
2 hours later…
2:39 AM
@roganjosh Yes, you must shevel forthwith.
 
2:55 AM
Suggestion for the room rules, maybe as a nudge or a guideline: if a discussion about helping someone solve a problem becomes protracted, please move it to a temporary private room - Generously apply user discretion and common sense.
@Kevin
@Code-Apprentice, I did not know you could use python with IntelliJ; how does that compare to Pycharm?
 
 
3 hours later…
6:31 AM
Greetings all - i need some help in python
I have data frame , one column is completely in hex format , i need to convert into ASCII format , How do we convert the entire column value from hex to ASCII
 
that's a very common question, have you searched?
if your hex doesn't look exactly like that, show a small sample
often beginners think everything is "hex" (or "unicode" or "ascii", or "encrypted") if they don't know what it is
can't help with the Pandas part if that's where you are stuck, I'm afraid (though I imagine it should be in the 101 documentation)
 
Yes , i am able to convert single hex to ASCII , how do we apply to entire column , which have 100,000 records
 
you've got a lot of first google hits ;P
 
different search phrases depending on the precise problem, which of course the OP is not revealing
a better question would look like "I want to do X, I have tried the steps A B C D, but the result from C isn't exactly what D needs to produce X" with actual code
helping us see that you can handle A and B and D lets us focus on the actual problem rather than start from "is it plugged in" and "do you know Python"
 
6:51 AM
54786e3a204372656469740a416363743a3258582e2e3631580a416d743a4e474e20312c3030302e30300a446573633a4d4f422f5554552f333136343333363839322f5472616e736665720a446174653a33302d4170722d323031392032333a35390a42616c3a4e474e20352c3935312e31350a4c454f3a68747470733a2f2f676f6f2e676c2f474e646f363
i have code like this in records
 
cbg guys o/
 
bytes.fromhex("54786e3a204372656469740a416363743a3258582e2e3631580a416d743a4e474e20312c3030302e30300a446573633a4d4f422f5554552f333136343333363839322f5472616e736665720a446174653a33302d4170722d323031392032333a35390a42616c3a4e474e20352c3935312e31350a4c454f3a68747470733a2f2f676f6f2e676c2f474e646f3631").decode()
from the first link I posted
so your problem is not with the decoding, and we are still only speculating about which part you want to ask about
(I had to add one digit because your sample had an odd number of hex)
 
 
2 hours later…
9:08 AM
@smci this suggests that I only had my chance to be shevelled in the 1600s. Now I really do have my excuse :)
 
9:25 AM
@ReblochonMasque users discretion usually does that on their own
 
Also in that thread: "For a while we had an official team gruntler. One of those people who just smooth ruffled feathers by the way they listen and care about you." I think that is a fantastic idea. I was almost done with it until someone asked if you can be "combobulated"
 
Yes @AndrasDeak, maybe it is not necessary to add this recommendation; I was a bit peeved by the wall of long posts pertaining to one topic that went on and on.
 
 
2 hours later…
11:37 AM
@ReblochonMasque I assume that suggestion was prompted by the R - Python discussion between Code-Apprentice & smci. We normally handle stuff like that on a case-by-case basis, but I guess it wouldn't hurt to have a room rule that covers discussions that are so localised that no other room visitors are likely to be interested or able to contribute.
 
ello
 
It's not really a big deal when the room is quiet, and stuff like that's easy enough to skip over in the transcripts.
Hi, pi person.
 
just wanted to ask whether sorting all the particles by their x coordinates in a physics sim and then seeing how close together each element is from the next is a good method of collision detection?
or is that a complete monstrosity
 
Yes, that was it. Indeed @PM2Ring, no biggie. I contend that it could be mentioned in the rules as a suggestion that could help the room attendees know what options are available to them when they realize they may have over reached?
 
@3141 Yes, that can work ok, if the particles are vaguely randomly distributed.
 
11:43 AM
nice
would that work if the particles started out in an even block shape
in a grid formation
 
@3141 how many dimensions?
 
2
 
consider a case where three particles are at (0.99, 0), (1.00, 5), (1.01, 0.01)
 
yes
 
@3141 I suppose so. It depends if the particles tend to form clusters for any reason. And as Andras said, the number of dimensions can also have an impact.
 
11:46 AM
if you're only ever checking consecutive pairs in x you'll miss (0.99,0) close to (1.01, 0.01)
 
ah andras youre right
any ideas about overcoming that?
 
not doing what you suggested ;)
 
alright then, back to the drawing board
 
but collision detection in molecular dynamics simulations is a very mainstream thing, there should be more than enough resources
 
thanks
 
11:47 AM
I bet there are efficient algorithms, not too hard to find
 
sure, but im quite keen on writing my own from scratch at the moment
 
the algorithm as well?
 
ye
 
well, then drawing board it is :D
 
alright then
btw nice to see you active as ever andras
 
11:48 AM
thanks?
 
idk, thanks for the help
 
no problem
 
@3141 Seriously, I suggest you research the existing algorithms. Since the middle of last century, there have been many thousands of person-years invested in investigating stuff related to nearest neighbours & clustering.
 
yeah, i think i will, but id really like to try myself first
sorry for being frustrating
 
@3141 Not a problem. It's good to try & do this stuff for yourself so that you get a feel for the issues involved.
I don't know much about collision algorithms. Maybe quadtrees could work for your case.
 
11:57 AM
ooh ok
ill take a look
that does look promising actually
 
I know a bit about clustering & nearest neighbours as it relates to colour spaces: efficiently creating colour palettes and mapping images to palettes. Mostly in C, for speed, but I've done some stuff in Python, using PIL & Numpy to handle some of the processing.
 
ok, that turned out to be very helpful
thanks for that
 
No worries.
@ReblochonMasque I think there's no harm in adding a brief note to that effect in the room rules, but I'll discuss it with other ROs first.
 
12:18 PM
Sure, thanks. :)
 
12:33 PM
I've been thinking about what you said @PM2Ring about black holes being cold in a previous conversation. I came across this and find myself confused about the term "temperature"
This all seems to be in regard to what is emitted but, to me, temperature is an internal state. It doesn't depend on what is emitted to the surroundings?
 
Thank you for asking @roganjosh, this is a very interesting question. I'll be observing from the sidelines.
 
As I see it, all of the mass and energy of the surroundings is drawn in. Why does that not make the singularity infinitely hot?
 
@roganjosh We don't know what's inside and I think thermodynamics included
 
If thermodynamics breaks down though, is there any meaning to "temperature" in this case? I assume there is, but it's not in line with my traditional understanding
Im guessing it's being used in layman's terms because they didn't clarify it at the end of the article
 
@roganjosh inside? I wouldn't bet. Outside, if an object emits light according to Planck's law it makes sense to identify the corresponding temperature
"Temperature" is the intensive quantity conjugate to entropy, so... :P
 
12:40 PM
Right ok, that makes sense :)
 
But I only suspect the inside thing
PM will know more
To be honest I'm surprised it's thermal radiation, but since it is it can't be coincidence. That temperature comes from somewhere.
 
Leaking from the infinitely hot singularity :P
I have to go get my train soon so I may not be able to participate until this evening. At least it's got me thinking :)
 
Exactly, last time I looked, I got stuck at the point where you measure temperatures of bodies from their emitted radiation, but quid of a BH that doesn't radiate?
 
It does radiate. But different mechanism: Hawking radiation
 
From an engineering point of view we would have conductive, convective and radiative heat transfer. From a physics point of view, are they the same mechanism, just different mediums?
My understanding of conductive transfer would be through a physical mechanism of contact between materials, but this measurement of temperature is just accounting for radiative transfer
 
12:57 PM
No, those are different
 
I'm aware this is somewhat tangential
I'm trying to slot this into a deficient mental framework
 
But temperature and heat transfer are independent concepts to an extent
 
@roganjosh Sorry about the delay. I was busy on MSE... I just had a quick look at the article you linked. Yes, black holes have a temperature, but the amount of power they emit is ridiculously tiny, and it's not exactly emitted by the singularity of the BH, or even by its event horizon. It's emitted by the space outside the event horizon.
 
@roganjosh so the colloquial impression of temperature is "hot/not hot" but when you put your hand on something you're really feeling heat transfer, not temperature (see 100-celsius copper vs. 100-celsius polystyrene). It's further muddled by the fact that heat transfer leads to an increase in temperature, which means that it also leads to thermal equilibrium, so our thermometers are usually based on heat transfer
but it turns out that if you use conduction to measure temperature (thermometer) or use radiation to measure temperature (measuring thermal radiation spectrum) you'll get the same temperature
And with Planck's law, what we usually imagine is that a cavity in equilibrium will contain electromagnetic radiation that is in thermal equilibrium with the walls of the cavity. This is described by Planck's law which uniquely identifies temperature. But even outside equilibrium we end up seeing this radiation by anything that has finite temperature (in other words, everything). Still I tend to think of this as the surface of objects that's emitting the radiation.
Now, with a black hole, if a black hole does have a surface, any radiation emitted by that surface would be deep inside the event horizon so we'd never see it. Thus any radiation we do see from a black hole doesn't come from the black hole itself
And if you think "why black hole if it radiates?", consider that the ideal radiation described by Planck's law is called black-body radiation, because interestingly it's the radiation emitted by a body that absorbs 100% of all EM radiation it receives. So the blackness of a black body, just like the blackness of a black hole, relates to the fact that if you shine a light on it, it'll eat it all up. Still they radiate :)
</nerd>
 
Here's a crude analogy: if you stress stuff, it tends to heat up. Eg, bend a piece of coat-hanger wire a few times, and the bend gets quite warm. In the immediate vicinity of a BH space itself is so stressed that it heats up, but due to the way general relativity works, the amount of heat radiation in the region that an observer sees depends on the observer's motion.
To get some solid numbers, we can use this handy Hawking radiation calculator. Eg, a small BH, 3 times the mass of the Sun, has a Schwarzschild radius just under 8.862 km, and radiates 10^-29 watts at a temperature of 20 nanokelvin. Larger BHs have colder temperatures.
 
1:16 PM
that's nice in W/m^2
 
Ok, between the pair of you, I have a much better understanding. I think :) thanks. We learned about black body radiation but I didn't have a proper idea of how it fit in with any of the things I was doing in engineering. It makes more sense now I see it extrapolated outside of my own domain
I guess for my question w.r.t. the singularity, I best give Elon Musk a tinkle and book my next voyage
 
We don't know what the core of a BH is like. We need a quantum gravity theory to address questions like that. It might be a mathematical singularity, but most physicists expect that quantum effects will fuzz things out, preventing a singularity.
And even if we do have a quantum gravity theory, we'll never be able to verify its predictions about BH cores, since no information about the inside of a BH can ever cross over the event horizon.
 
1:34 PM
all our attempts at reconciling quantum and gravity fail, so hopefully by the time we figure it out we'll be a few paradigms further down the road and perhaps we'll know something that will allow confirmation
 
But if the BH core is a mathematical singularity, as predicted by pure non-quantum GR, then it's still not an easy thing to think about. The singularity is never in the past of any observer, even one who's fallen into the BH, heading towards the singularity.
Also, it's not like a point in space, more like a point missing from space. If you made a map of a BH, the singularity is not like a blank region on the map, with the words "there be dragons". It's like there's a hole in that section of the map
@AndrasDeak Well hopefully we'll have various other observations to help confirm quantum gravity, that'll give us some confidence that it works correctly in regimes where we can't make direct observations, like inside BHs, or the instant of the Big Bang. But even doing those other observations will be technically challenging, eg up close observations of extreme gravity situations like neutron stars and BH accretion discs.
 
1:55 PM
I'd love to see a neutron star
 
@AndrasDeak not too close up I hope :)
 
Not sure how deadly it is if we go there... rough magnetic fields, so leave your pins at home
 
but... If I don't go out with my pins - I don't feel properly dressed! :)
 
closed
 
2:15 PM
Wow... just learned a word I could sadly get a lot of use of: german.stackexchange.com/questions/54648/…
 
@JonClements panta rei being helpful :P
 
Related to the Pauli Effect
 
A lot of heated physics discussion here.
 
yesterday, by Andras Deak
@Dair :|
 
2 days in a row.
 
2:34 PM
@Dair We do that, from time to time, especially during off-peak times, if there aren't Python discussions going on. We also occasionally have discussions about other topics, like food and music.
 
food wise... quite a bit of it is "salad" :)
 
@ReblochonMasque My company pays for an IntelliJ Ultimate License for me. It has a plugin available for Python that basically has the features of PyCharm. There's some differences in the UI, but afaik, it's otherwise the same.
 
2:56 PM
Noted, thank you @Code-Apprentice!
 
3:30 PM
@smci yes, this seems somewhat related. Some digging yesterday showed me that my code is using a method named "BFGS" instead of Nelder-Mead.
 
 
2 hours later…
5:05 PM
@ReblochonMasque Why did I bother? I decided to help Code-Apprentice understand whether it was/wasn't on-topic on Python (vs R, or replicability), and help them ask their questions better in a way that gets answers, since they weren't getting answers. I see lots of conversations here that do not interest me in the least. Moving it to another room would prevent any future new users finding it. I wouldn't have bothered continuing unless I thought there was something in it some new users would appreciate.
 
Weird, I wouldn't expect most users wanting to translate R to python. Same as if I helped someone translate MATLAB to python I wouldn't expect that to interest anybody else.
but I acknowledge your motivation
 
Yo @Code-Apprentice long time!
How is Android development coming along? :)
 
5:27 PM
Like every couple of months, I'm once again considering to learn how to properly package and publish some of my stuff. But only if it's not too much effort. So, can someone tell give me a TL;DR of what releasing a first/new version of a module entails? Is it as easy as incrementing the version number and pushing to master, or is there other stuff that needs to be done (like building wheels or something)?
 
you mean on pypi?
 
that's another thing I'm still undecided about. I'll probably start by just making it installable from github
 
People don't like Q-Learning? I made a simple question, but there's no answer, could someone help? stackoverflow.com/questions/58243791/…
 
github doesn't offer a python package index yet
 
i just want to know how to create a a Q Table for a simple environment
 
5:31 PM
Doesn't pip support installation from github? Like pip install git+ssh://git@github.com/repo or something like that
 
yeah, it does
 
it does, but then it needs to execute the setup.py
 
which is fine for Aran I think
which means you need a setup.py and a few __init__.pys
 
It's not an arbitrary code execution vulnerability if the code is my own, so I don't care about executing setup.py :D
 
I have a dumb little installable package (locally) that needs just that ^
 
5:34 PM
@Aran-Fey did you already read this? packaging.python.org/tutorials/packaging-projects
 
many moons ago, yes
hmm, or maybe not. Might've been something that looked similar
 
well, you only really need to pass name and version into the setuptools.setup call, plus dependencies. Do you have all these?
 
not yet
What about requirements.txt and pyproject.toml and whatever other files there are - is any of that still relevant or all outdated?
 
requirements.txt is outdated and should never have been used as means to document package requirements in the first place. pyproject.toml is a new general packaging config that is neat, but not well supported. Not for pip install from github anyway, so it's not that interesting yet
 
alright, thanks. Reading the thing you linked now
By the way, any recommendations about which license I should use?
 
5:43 PM
MIT is more or less standard for opensource now, I think
the "I don't care, just use/fork it if you want, no warranty." license
 
sounds good
 
@smci True, moving the discussion to another room would make it harder to find... unless you put some useful keywords and phrases here, with the link to your room. On the plus side, it means the transcript of your conversation isn't interrupted by other chitchat.
 
@Aran-Fey last time I asked myself I perused choosealicense.com but I didn't really reach enlightenment
might still be worth taking a look at
or was it another site, this seems to be microsoft's github's
 
@Aran-Fey the dl;dr is that you want to have the following structure:
myproject
├─setup.py
└─myproject
    ├─__init__.py
    ├─module_1.py
    └─module_2.py
 
(here was my take in the MATLAB room)
not verified to know what I'm talking about though
 
5:48 PM
@AndrasDeak Been looking for that one! Super useful
So if I don't intend to upload it to pypi, I can stop reading at "Generating distribution archives"?
 
absolutely
that page is more of a reference anyway
now that i looked at it, the setuptools docs might be better that the pypa docs setuptools.readthedocs.io/en/latest/setuptools.html#basic-use
just for completeness sake, the minimal setup.py that would make a project that looks like the one above installable is something like this:
import setuptools


setuptools.setup(
    name='myproject',
    version='0.1.0',
    packages=setuptools.find_packages(),
    requires=[
        'something',
        'something_else'
    ],
)
 
6:08 PM
thanks, I'll give it a shot after dinner
 
gl hf
 
@PM2Ring I will not bother responding to users like that unless it's perceived to be of general use (e.g. to future new users, how to ask a question to get responses, etc.); so I wouldn't bother having that conversation in a private room. None of the rest of you here or elsewhere on SO responded to the user's questions. (I reasked on their behalf in the main R room 'GMTs' and that finally got a response: chat.stackoverflow.com/transcript/message/47489078#47489078)
 
it's not that complex to make a package installable. there is only two pitfalls, really: 1) tweaking your project to still work properly if you are trying to do something strange, and 2) knowing what setuptools considers to be "strange"
 
...what does setuptools consider "strange"?
 
@smci I could've responded with "I don't know R". Would that have made you happier?
no wait, I even did that
 
6:17 PM
@Aran-Fey personal favorite: having non-.py files in your package.
 
well, there's the license and the readme...
 
aha! those are metadata, so you need to read them in the setup.py and include them in the setuptools.setup call under license and description_long, respectively
I was talking about things like config files next to your code files. those don't get picked up automatically
 
ah, I see
 
it's messy
 
6:33 PM
@Arne is that necessary for package managers?
 
7:17 PM
cbg! Hey guys, I have a question for you. How do you navigate to room 6? You log in to SO, then what?
 
I type https://chat.stackoverflow.com/rooms/6, then my browser remembers that URL, and I only need to type chat after that
 
I just never close the tab ¯\_(ツ)_/¯
 
@AndrasDeak I wasn't speaking to you, and anyway that's irrelevant to what's being discussed (whether I should have engaged with the user, in this room).
 
Apologies, I thought "None of the rest of you here or elsewhere on SO responded to the user's questions." was somehow a commentary on something the rest of us here did or didn't do
 
That's a good question. I don't know any way to get to chat from SO
 
7:25 PM
it's in the hamburger menu
 
I just Google it; "stack overflow python chat" is a saved search for me
 
top right corner
 
Mm, I'll have a look then when I get home :) I can't even remember how I came across chat but I don't think it was the UI
 
it's right there so that nobody can find it
 
Oh man, that?
 
7:27 PM
that's the so-called hamburger menu
 
It looks like a support link
 
no wait, the hamburger is the top left :D
 
I know the menu you mean, I mean that chat right at the top looks like it's some support link in SO. That might actually be for the best :P
 
I still see it :P
 
7:29 PM
it looked differently when I started but even then I only found chat via a user's profile
@roganjosh for posterity
@smci in any case you did well for engaging the user, we were only talking about whether at one point you could've went to a dedicated chatroom for the problem
 
7:51 PM
oh THAT's where it is... I always use the description of the python tag. Or the chat reply notification
 
your browser doesn't suggest urls?
 
8:13 PM
I never use cookies...
 
Hmm, can I not import my package in setup.py? This is my setup.py, and this is (part of) the error I get from pip.
oh, it's probably because of name = HERE.name
 
@Chillie that sounds like a non sequitur
 
sorry, I meant incognito mode. No history, no cookies.
 
I see
 
suspicion confirmed, name = setuptools.find_packages()[0] fixed it
Now that it's installable I suppose I should update my documentation... and do something about this searchbar
 
9:10 PM
@AndrasDeak assuming that with "package manager" you mean the human kind, the long_description is what pipy renders when you search for the package via a browser, so it's only useful if you upload it it to an index. The license.. I think if code isn't bundled with a license, the default is "private", which means that you can't use it commercially or in open source. So if you want your code to be used, you should add one.
 
@Dair <shakes head slowly and disapprovingly> 3rd time lucky, maybe? :P
 
@Arne "upload it to an index" is what I meant for the former, thanks. And the license is still valid if it's just sitting there in the project under LICENSE, right? So that also means "yes", probably
 
@AndrasDeak it's common to include it in the package as well, then third parties don't have to download it from github if they need to bundle it
 
but that's also for pypi, right?
 
pipy will show it as well then, but an installed package also knows about it's license
 
9:16 PM
hmm
@Arne where does it manifest that it knows? Tried googling it but failed
 
got it, thanks
It's right there in pkg_resources.require(package_name)[0].get_metadata_lines('PKG-INFO') :D
 
Python packaging is a beauty beyond words
 
at least I wasn't missing something trivial like module.LICENSE or a dunder
 
Are there any languages where packaging isn't horrible?
 
9:23 PM
Rust people always seem happy with cargo, but i never got to try it myself
@Aran-Fey i saw your version extractor, it's scary
 
Know a better way to do it?
 
so the packaging howto tells me to put the license description manually in classifiers rather than using LICENSE somehow, but I suspect the latter is relevant when there's a custom license
 
I guess I could do a sys.path.insert
 
friends don't let friends insert into sys.path
 
I definitely should do a sys.path.insert rather than use importlib
 
9:27 PM
not sure about setup.pys though...
 
My setup.py probably doesn't work in 3.5, and definitely doesn't work in 3.4
argh, I should probably get rid of pathlib, too
 
@Aran-Fey i have a VERSION.py in my package that contains only the version
 
In the same directory as the setup.py?
 
No, in the source code
 
Then I don't see how that makes the import easier?
 
9:30 PM
I think it's nice if the code knows which version it has, but opinions differ. I definitely also saw project that only have a version hardcoded in the setup.py directly
@Aran-Fey I don't import it, i exec it
The version file, that is
 
I'm getting pretty confused with Big O in this. 2357122 already told me it's O(1) and like yam am I going to dispute that, but it goes against all my senses. Is there even value in Big O evaluation in this case?
 
@roganjosh you're saying the same thing
 
@Arne now you lost me completely :D
 
there's no scaling parameter so it's constant with respect to anything
 
But there's an upvoted answer saying it's n^3
 
9:33 PM
read it more carefully
> Consider the general case for any integer N:
the answerer changed the problem and added a parameter
The original question had for j in range(3) for k in range(4) which could imply one or two different parameters. It could be O(f(n)) or O(f(n,m)), respectively, and until OP edits to something that has any kind of asymptotics it won't be answerable. We can guess, but we don't have to.
 
I'll answer, but am on phone right now, and it would take a while =D
 
I had a look at your github repos and saw some funky exec business going on. Haven't found a project with a VERSION.py though
 
well he execs it, so he doesn't add it to version control for security reasons ;)
 
new setup.py version: dpaste.com/2GJ804N
took me 3 attempts to get the HERE = ... line right without pathlib
 
So all my pypi-installed packages seem to have 'METADATA' rather than 'PKG_INFO', but not my custom module. Hmm...
@AndrasDeak so actually that's (pkg:=pkg_resources.require(package_name)[0]).get_metadata_lines(pkg.PKG_INFO). Delightful.
 
10:04 PM
autodoc is drunk... it just generated this broken function signature: class introspection.Signature(parameters=None, return_annotation)
 
ninja arguments
 
@Aran-Fey I moved to poetry for all my private projects, packaging is a little different then. the main idea is that it's risky to actually import your own code during built time, because it isn't installed at that point. so to stay safe, instead of doing version = mypackage.version I do exec(open('mypackage/VERSION.py').read()), with the content in VERSION.py being exactly version = "0.1.0"
 
oh, that's actually understandable. The default value for that parameter is actually inspect.Parameter.empty. Shouldn't be surprised that that causes problems
 
if my reasoning sounds vague, that's because it is. I just remember burning myself a bunch of time some months ago, and deciding to never again try to import my source code during build time. It's very likely that you're smarter than me and just avoid the things that tripped me
 
Ok, I see. I don't think not being installed will be a problem for any of my modules, so for the time being I'll leave it as it is
 
user6568562
10:16 PM
@roganjosh I feel this question is some kind of exercise at the end of a Big-O Notation chapter with an aim to hammer down the point that the N is related to the size/nature of the input, not constants/fixed operations
 
11:17 PM
@randomhopeful I think you're probably right and it's thrown me
 

« first day (3276 days earlier)      last day (1686 days later) »