New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Interface #6
Comments
Hi Harrison, I have been working on this for last couple of days in a private repo. It's basically done. Just need to do some testing. What do you think is the best way of making this open source? Should the Python version have it's own repo? |
Hi @am5113 the best option would be to add that as a pull request to this repo with python as a new folder. However, anything that gets added needs to be updated regularly with changes to the model. |
Hi @am5113 I've put some extensive notes out of the way, here: Sorry, no time to make short and clear. About subsequent steps unleashed by yours. |
Added the main data-wrangling class to the python branch up to line 166 in The rest should follow up quite nicely by using |
@s-mishra, I agree. I'd be happy to stay on top of this. I'm sure there's an army of Python coders who will make sure of it too. |
@am5113 thanks for your enthusiasm to contribute to our project! I will soon submit a PR as well with an implementation that I have done as well - I think we should merge our work to avoid replication :) |
Both, for what it's worth I've also got a Jupyter notebook that also replicates the data-wrangling features of base.r. Ignore if it just lowers S/N but let me know if I can help. |
@defjaf oh that's cool stuff - do you have a link? I can show you the class I made for data wrangling to compare: https://github.com/ImperialCollegeLondon/covid19model/blob/python_integration/Python/dataset.py |
You can also check mine out at: https://github.com/am5113/covid19model/tree/master/Python I put in a crude test using rpy2 to check that the consistency between R and Python. |
A pull request has been made to develop an initial prototype #13 |
There's a working notebook at https://github.com/defjaf/covid19model/blob/master/python_ahj/COVID19-base.ipynb It's basically a direct translation of It uses numpy, pandas and pystan, as well as some utility code (adapted from Michael Betancourt <@betanalpha>) included in the repo. |
To make it easier for further development within the community, I suggest we convert some of the pre-stan code in
base.r
into Python. Should be mostly a pandas-numpy-datetime job. After which we can use the Pystan[https://pystan.readthedocs.io/en/latest/] interface to compile the Stan code and ingest data via Python.The text was updated successfully, but these errors were encountered: