The basic need I have is to convert the codes in a MEDDRA dataset to CUIs (UMLS concept unique identifiers). If there were only 10 or so, I’d look them up on the Metathesaurus manually…but I have a dataset of 155 related to COVID-19. Once I have the CUIs, I can limit the output from…
Category: python
Default Values for max and min
I rely pretty heavily on Python’s min and max function when trying to take the highest or lowest values from a particular algorithm. For example, a regular expression extracts scores (these could be grades, number of pages in a book, distance run, etc.) from an input document. The document may contain multiple scores (e.g., describing…
Simplify Project Setup with Cookiecutter
Nearly every time I kick-off a new Python project, I follow the same set of steps: And then I feel about ready to grab some lunch or call it a hard-worked day at the office. Each time I follow these steps, I have realized that this should be automated. In fact, the only non-automatable part…
Install Package from within Jupyter Notebook
I often use Jupyter Notebooks, usually from within the (default) web browser interface, though I’ve been increasingly liking the direction that PyCharm’s interface has been going (e.g., see the feature page: https://www.jetbrains.com/pycharm/features/scientific_tools.html). One of the problems I regularly encounter, however, is that some package (e.g., pandas) is not installed on whichever virtual environment I’m using….
ERROR: Not a supported wheel on this platform
Installing spacy on a new Windows 7 virtual machine, and running into trouble (per usual). The appropriate way to do this is to usually to install Build Tools, but it always seems quicker to grab the necessary wheels from Christoph Gohlke’s website: https://www.lfd.uci.edu/~gohlke/pythonlibs/. Selecting the appropriate set under spacy along with cytoolz and sometimes ujson….
Configuring TensorFlow to use GPU on Windows
A couple years ago, I had attempted to get involved in Tensorflow/Keras but go waylaid with a few projects. Anyway, I have a new use case to be able to touch my toe in that water (more to come). The configuration is not difficult, but can be time consuming, so I thought it worth recording…
Adding PyPI Update Github Action to Existing Project
I’ve now been updating a few projects to also automatically update PyPI with each new release (see https://foggyprogrammer.com/github-actions-updates-pypi-package for context), but have run into a couple snags: TestPyPI submission fails when the version is not updated. I mostly work on the master branch and each new commit tries to push a new build with the…
GitHub release updates PyPI Package
I had wanted to follow the guide for automated PyPI releases here (https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/), but ended up getting carried away with the PyPI packaging process. Now, I can turn to updating my three repositories to automatically deploy new releases to PyPI. Begin by creating new tokens for the PyPI package on both testpypi and pypi proper…
Add Python package to pypi
I’ve uploaded a couple pypi packages in the past, but have never really kept them updated. Apparently, the updating process can be automated using Github Actions: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/. (I’ll look at the next time.) For now, I’m going to use this tutorial (and revisit pypi-setup doco) to add a new package, regexify, and update it so…
hypothesis for strings
I’ve never tried hypothesis. I recall watching a talk several years ago and thought how great an idea it is…but like with too many great ideas I witness, my lack of follow-up is disturbing. The goal of a library like hypothesis is to do ‘property-based testing’. Random data is provided as input (random data which…