[OT] - Re: Has anyone worked on docker with windows

2017-11-30 Thread Michael Torrie
Marking this message as off topic, since it has nothing much to do with
Python and Python programming.  In fact this whole thread should have
been started on a Docker-specific forum, mailing list, or USENET group.
To the original poster: you should visit the Docker web site and access
the community resources they have there:

https://www.docker.com/docker-community

On 11/29/2017 09:03 PM, Percival John Hackworth wrote:
> To clarify, I think the OP was asking if they could Windows inside a Docker 
> container. Since Docker uses the kernel of the OS it's running on, that would 
> mean it would have to run natively on Windows.

Unless things have changed Docker has always been about running Linux
software in Linux containers on all supported OSes, which includes Mac
and Windows. On Mac and Windows this requires running a VM, although now
with Docker for Windows it can run the Linux containers on the
integrated HyperV virtualization system, so you don't necessarily need
to install VirtualBox or VMWare.

https://www.microsoft.com/en-ca/cloud-platform/containers

> Back in January, it didn't run on Windows. Now apparently you can run a 
> Windows 10 or Server 2016 environment in a container. I would think, given 
> the architecture of Docker, that you can only do this on a Windows machine, 
> not a Linux box. So the ability to containerize an application on Linux and 
> run it anywhere Docker is installed (even MacOS) only applicable to Linux 
> apps.

Docker has run on Windows since very early on.  Not quite sure why you
say it didn't run on Windows back in January.

As for running Windows applications in a Windows container, this is not
possible using any container technology I'm aware of.  I'm sure MS could
one day build Windows-centric containerization into Windows, but there's
no support now.  I guess they haven't figured out how to work out the
licensing.  Proprietary licensing and containers would be complex.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to upload to Pythonhosted.org

2017-11-30 Thread Irmen de Jong
On 11/30/2017 03:31 AM, Ben Finney wrote:
> Irmen de Jong  writes:
> 
>> On 11/30/2017 02:06 AM, waylan wrote:
>>> So, how do I upload an update to my documentation?
>>
>> I ran into the same issue. From what I gathered, Pythonhosted.org is
>> in the process of being dismantled and it hasn't allowed new doc
>> uploads for quite some time now. I switched to using readthedocs.io
>> instead.
> 
> The issue that many are facing is how to update the pages *at the
> existing URL* to tell visitors where to go next. Cool URIs don't change
> https://www.w3.org/Provider/Style/URI.html> but, when they do, we
> are obliged to update the existing pages to point to the new ones.

Sorry, yes, that is the problem I experience as well. My library's old version
documentation is somehow frozen on Pythonhosted.org (and obviously still pops 
up as the
first few google hits).


> So, if pythonhosted.org is indeed being dismantled, there should be a
> way to update the pages there for informing visitor where they should go
> next.
> 
> If that's not possible and instead the service is just locked down,
> that's IMO a mistake.

I agree with that. I think it's an unsolved issue until now, that gets some 
discussion
in this github issue https://github.com/pypa/warehouse/issues/582


Irmen




-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [OT] - Re: Has anyone worked on docker with windows

2017-11-30 Thread Paul Moore
On 30 November 2017 at 18:49, Michael Torrie  wrote:
> As for running Windows applications in a Windows container, this is not
> possible using any container technology I'm aware of.  I'm sure MS could
> one day build Windows-centric containerization into Windows, but there's
> no support now.  I guess they haven't figured out how to work out the
> licensing.  Proprietary licensing and containers would be complex.

Way off topic certainly, but I just installed Docker for Windows
yesterday, and it has an option on the menu "Switch to Windows
containers". From a very quick Google search, it looks like there is
support for running Windows-based containers in docker now. There's an
image microsoft/windowsservercore available, which suggests this is a
supported solution.

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


advice for inventory software

2017-11-30 Thread Brian J. Oney via Python-list
Dear Python scripters,

I am writing modules for my insectary (for food), the processes of which I plan 
to mostly automate.

Currently, inventory and the traceability of material flows is my focus. My 
best idea (yet) for making things as simple as possible consists of a debian 
server hooked up to a barcode scanner. The input of information would consist 
of scanning barcode sequences (Start process, item1, ..., stop process). 

For this, I plan to implement a listener to the usb port, which takes the input 
and knows what to do with it. Later on, there will be multiple simultaneous 
input sources. For now, I imagine a simple flask app capturing the input and 
feeding it into an SQL database. 

Certainly, someone has had the opportunity to something similar if not 
identical. I would be particularly greatful for advice on design and work 
already done.

For those interested, I have my progress on github.com/oneyb. I almost done 
with the basic inventory barcode printing functionality I need.

You may think I am reinventing the wheel. If so, why would I ask for advice? 
Also, the highly closed nature of the insect breeding business, my slim budget, 
and the desire to easy extend functionality in the near future (plus a mild 
case of 'I wanna code' [aka NIH] syndrome), push me to learn and implement this 
myself.

Thanks in advance!

Cheers

Brian
-- 
https://mail.python.org/mailman/listinfo/python-list


Is it useful to set a fraction number here to the mask value?

2017-11-30 Thread Robert
Hi,

I am new to Python. Now I follow a thread on mask array usage on line:


https://stackoverflow.com/questions/31563970/fitting-a-binomial-distribution-with-pymc-raises-zeroprobability-error-for-certa


I understand the problem, but I don't understand the answer follow the link.

Because the 'mask' array is composed of integer, if it is assigned a fraction
number as suggested a 1.5, it will be formatted to an integer 1.
 

observed_values = sp.random.binomial(n = 10.0, p = 0.1, size = 100)
...
mask = sp.zeros_like(observed_values)


Are you clear the answer's meaning?


"You can give it a non-integer value in order to avoid the problem that you 
cite. 
For example, if you fill with, say, 1.5 that should work."




Thanks in advance
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is it useful to set a fraction number here to the mask value?

2017-11-30 Thread Robert
On Thursday, November 30, 2017 at 6:17:05 PM UTC-5, Robert wrote:
> Hi,
> 
> I am new to Python. Now I follow a thread on mask array usage on line:
> 
> 
> https://stackoverflow.com/questions/31563970/fitting-a-binomial-distribution-with-pymc-raises-zeroprobability-error-for-certa
> 
> 
> I understand the problem, but I don't understand the answer follow the link.
> 
> Because the 'mask' array is composed of integer, if it is assigned a fraction
> number as suggested a 1.5, it will be formatted to an integer 1.
>  
> 
> observed_values = sp.random.binomial(n = 10.0, p = 0.1, size = 100)
> ...
> mask = sp.zeros_like(observed_values)
> 
> 
> Are you clear the answer's meaning?
> 
> 
> "You can give it a non-integer value in order to avoid the problem that you 
> cite. 
> For example, if you fill with, say, 1.5 that should work."
> 
> 
> 
> 
> Thanks in advance

Excuse me for the top post. Now I find the more specific question from the below
link:

https://pymc-devs.github.io/pymc/tutorial.html


At almost the bottom part of the web page, when I run the script

"masked_values = masked_array(disasters_array, mask=disasters_array==-999)"

has an error:

... masked_values = masked_array(disasters_array, mask=disasters_array==-999)
Traceback (most recent call last):
  File "", line 7, in 
NameError: name 'masked_array' is not defined

I use Python 2.7 on Ubuntu 16.04, 64-bit. Is there an error in the pymc 
tutorial web page?

Can you tell me what is wrong?

Thanks,

===
# Switchpoint
switch = DiscreteUniform('switch', lower=0, upper=110)
# Early mean
early_mean = Exponential('early_mean', beta=1)
# Late mean
late_mean = Exponential('late_mean', beta=1)

@deterministic(plot=False)
def rate(s=switch, e=early_mean, l=late_mean):
"""Allocate appropriate mean to time series"""
out = np.empty(len(disasters_array))
# Early mean prior to switchpoint
out[:s] = e
# Late mean following switchpoint
out[s:] = l
return out


# The inefficient way, using the Impute function:
# D = Impute('D', Poisson, disasters_array, mu=r)
#
# The efficient way, using masked arrays:
# Generate masked array. Where the mask is true,
# the value is taken as missing.
masked_values = masked_array(disasters_array, mask=disasters_array==-999)

# Pass masked array to data stochastic, and it does the right thing
disasters = Poisson('disasters', mu=rate, value=masked_values, observed=True)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is it useful to set a fraction number here to the mask value?

2017-11-30 Thread MRAB

On 2017-12-01 01:43, Robert wrote:

On Thursday, November 30, 2017 at 6:17:05 PM UTC-5, Robert wrote:

Hi,

I am new to Python. Now I follow a thread on mask array usage on line:


https://stackoverflow.com/questions/31563970/fitting-a-binomial-distribution-with-pymc-raises-zeroprobability-error-for-certa


I understand the problem, but I don't understand the answer follow the link.

Because the 'mask' array is composed of integer, if it is assigned a fraction
number as suggested a 1.5, it will be formatted to an integer 1.
 


observed_values = sp.random.binomial(n = 10.0, p = 0.1, size = 100)
...
mask = sp.zeros_like(observed_values)


Are you clear the answer's meaning?


"You can give it a non-integer value in order to avoid the problem that you cite. 
For example, if you fill with, say, 1.5 that should work."





Thanks in advance


Excuse me for the top post. Now I find the more specific question from the below
link:

https://pymc-devs.github.io/pymc/tutorial.html


At almost the bottom part of the web page, when I run the script

"masked_values = masked_array(disasters_array, mask=disasters_array==-999)"

has an error:

... masked_values = masked_array(disasters_array, mask=disasters_array==-999)
Traceback (most recent call last):
   File "", line 7, in 
NameError: name 'masked_array' is not defined

I use Python 2.7 on Ubuntu 16.04, 64-bit. Is there an error in the pymc
tutorial web page?

Can you tell me what is wrong?

Thanks,

===
# Switchpoint
switch = DiscreteUniform('switch', lower=0, upper=110)
# Early mean
early_mean = Exponential('early_mean', beta=1)
# Late mean
late_mean = Exponential('late_mean', beta=1)

@deterministic(plot=False)
def rate(s=switch, e=early_mean, l=late_mean):
 """Allocate appropriate mean to time series"""
 out = np.empty(len(disasters_array))
 # Early mean prior to switchpoint
 out[:s] = e
 # Late mean following switchpoint
 out[s:] = l
 return out


# The inefficient way, using the Impute function:
# D = Impute('D', Poisson, disasters_array, mu=r)
#
# The efficient way, using masked arrays:
# Generate masked array. Where the mask is true,
# the value is taken as missing.
masked_values = masked_array(disasters_array, mask=disasters_array==-999)

# Pass masked array to data stochastic, and it does the right thing
disasters = Poisson('disasters', mu=rate, value=masked_values, observed=True)


Earlier in the tutorial there was:

>>> masked_values = np.ma.masked_equal(x, value=None)
>>> masked_values
masked_array(# etc

This shows that 'masked_values' is a 'masked_array' object.

A quick Google shows that it's numpy.ma.masked_array, i.e. defined in 
numpy.ma.

--
https://mail.python.org/mailman/listinfo/python-list