<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aumit Leon on Medium]]></title>
        <description><![CDATA[Stories by Aumit Leon on Medium]]></description>
        <link>https://medium.com/@aumitleon?source=rss-a24e73c0b8d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ni2A9smeq_5cJTQjh8gv_w.jpeg</url>
            <title>Stories by Aumit Leon on Medium</title>
            <link>https://medium.com/@aumitleon?source=rss-a24e73c0b8d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:16:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aumitleon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Publish Python Modules]]></title>
            <link>https://python.plainenglish.io/publishing-python-modules-b38026a51665?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b38026a51665</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 02:05:26 GMT</pubDate>
            <atom:updated>2021-07-19T16:26:53.690Z</atom:updated>
            <content:encoded><![CDATA[<p>How to publish Python packages (writing custom modules and publishing them to PyPI).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L4ALLCzRgS_lYiYI" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=medium&amp;utm_medium=referral">Chris Ried</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There are problems that require <em>specific</em> solutions, and problems that require <em>generalizable solutions</em>. This article is aimed at the latter, using python as an example. When building out large systems, it’s important to keep in mind the DRY principle — Do not Repeat Yourself! Repetition in a codebase can turn a simple change into a tangled mess befuddled by human errors — hence, <em>spaghetti code</em>. One way to reduce repetition in a single code base is through modularizing functionality — by decomposing repetitious code into modular functions, an update to a single function can replace the arduous task of updating code in distant corners of a codebase. But what if you’re building something bigger, and shared code exists beyond a single codebase?</p><p>Enter, <em>packages</em>. Every major programming language has some mechanism through which code can be shared and used by different people — Ruby has <a href="https://rubygems.org/">Gems</a>, Node has <a href="https://www.npmjs.com/">npm</a>, and Python has <a href="https://pypi.org/">PyPI</a>. Packages help reduce the effort required to compose software by modularizing pre-built functionality that can be <em>imported</em> and used in any codebase. If you wanted to write a python program that can graph a dataset, you certainly <em>could </em>write your own library to help facilitate this functionality, but this might not be the best use of your time. Graphing is a common problem, and common problems often already have solutions — the path of least resistance would be to import an existing library (such as <a href="https://matplotlib.org/">matplotlib</a>), and use that for your graphing needs (unless, of course, your need require a level of complexity and sophistication that existing packages can’t provide, in which case a more custom solution is required).</p><h3>Writing Custom Modules</h3><p>There are many reasons to write custom modules — you might want to package some functionality that would be useful in code across your organization’s codebases, you might want to open source a solution that worked well for a particular problem you solved, or you might just be interested in how programmers share code. Whatever the case, mature languages will almost certainly have the facilities to share code. In fact, I’d argue that any <em>moderately</em> useful language should have some type of package management solution — it’s impossible to efficiently write code if every time you want to do something as common as <em>print to </em><em>stdout,</em> you have to write the functionality to support the use case yourself. Of course, this is coupled with the question of how extensive should a language&#39;s standard library be — that&#39;s a discussion beyond the scope of this article, but I point the curious reader to Guy Steele&#39;s fantastic talk on <a href="https://www.youtube.com/watch?v=_ahvzDzKdB0"><em>growing a language</em></a>.</p><h3>Exploring Package Management in Python</h3><p><em>Note: I use the term package and module interchangeably. Semantically speaking, a package is a collection of modules, whereas a module is a single file. For the sake of simplicity, I illustrate examples of a module, but the same applies for packages in general.</em></p><p>With sufficient motivation for shared packages, we can now look into the tools within python that make this magic possible. pip is the utility that allows you to install packages in python — there&#39;s no shared consensus over what it actually stands for (&quot;<em>PIP installs python</em>&quot;? &quot;PIP installs packages?&quot;, or some other uninspired variation). Regardless of what it stands for, usage is incredibly simple. In our above example using matplotlib, we can install the package simply by running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*f8KCrCrhjWIVB1n5UdpXPQ.png" /></figure><p>Note: Some Python installations might not come with pip out-of-box. From the pip <a href="https://pip.pypa.io/en/stable/installing/">documentation</a>:</p><blockquote><em>pip is already installed if you are using Python 2 &gt;=2.7.9 or Python 3 &gt;=3.4 downloaded from </em><a href="http://python.org/"><em>python.org</em></a><em> or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.</em></blockquote><p>Now know how to install packages, but where do those packages come from?</p><h3>PyPI: Python Package Index</h3><p>The <a href="https://pypi.org/">Python Package Index</a> is the most popular public index of Python packages. Anybody can publish to or install from PyPI. If you have shared code that is sensitive (for example, shared code to handle auth within an organization), there are excellent private options, such as <a href="https://jfrog.com/artifactory/">JFrog Artifactory</a> or <a href="https://aws.amazon.com/codeartifact/">AWS CodeArtifact</a>.</p><p>pip defaults to using the PyPI index when installing packages, which you can confirm by observing the output from the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-HNBnPrX8vy-prf5FM3sA.png" /></figure><p>If you’re using a private option like Artifactory, you would need to create a configuration file that knows to use Artifactory when attempting to resolve packages.</p><h3>Writing a Python Module</h3><p>Writing a module in python to be shared across files in a single code base is as simple as defining a function and importing it into other files. If I define the following function in my_cool_function.py:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DA742xscfZjQGSsNJso4Jw.png" /></figure><p>I can import this function in another file as easily as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdnYq21BEZ-m8fuH2azkOQ.png" /></figure><p>But perhaps, my_cool_function is so cool and useful that you feel the need to share it with the world — you want to <em>publish</em> your module to PyPI. The difficult part is writing the module — actually publishing it is seamless once you have the proper infrastructure in place.</p><h3>Publishing a Python Module</h3><p>The base infrastructure for writing a module is the actual module code, and a few additional files. The basic module structure should look something like the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*_z-YPoctWRmCpu0iPZFlsQ.png" /></figure><p>The actual source code exists in src/. Along with the file we have for our code, we also have an __init__.py — this file lets python know this is a module directory. This is a contrived example — in reality, your module may have many more files in the src directory that serve as support for your core module. (Note: the src/ directory can actually be called whatever you desire — all that matters is that you properly identify the root directory of your source files in your setup.py, which we’ll get to in a moment.</p><p>The requirements.txt and requirements-dev.txt are standard within Python projects—they contain all of your project&#39;s dependencies (the split between a regular and dev file is purely up to the programmer, but there are always benefits to extra decomposition). Think of these files as containing a list of libraries that any end user would need to install in order to properly use your library (when the module is pip installed, these dependencies are downloaded automatically by pip).</p><p>The README.md is standard across most codebases (not just python) — this should contain a description of your module and whatever other information you want to include.</p><p>Finally, the files that actually provide the backbone of your module are MANIFEST.in and setup.py. MANIFEST.in specifies what additional files to include as part of your module (other than your source files), and setup.py is the actual module configuration. The setup.py file contains all of the metadata and information required to properly package your module for whatever index you want to upload to. An example for us might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vv-BF7nNuUyCMyUZYr8QwQ.png" /></figure><p>The above example is configure to include the README.md file along with regular and dev dependencies with the package definition. Most of this should be self explanatory, but of note is the name argument to the setup function, which the actual name of the package (i.e., you would install this module by running pip install my_cool_function. The packages arg specifies the location of the source files, in this case, src. The rest of the options are metadata for the package — for an extended explanation for each, check out the <a href="https://packaging.python.org/tutorials/packaging-projects/">docs</a>.</p><p>With the proper infrastructure in place, the final step is to actually upload and publish the package. To do so with PyPI, you need create an account at <a href="https://pypi.org/">https://pypi.org/</a>. Once you have an account, you’ll need access to your API key which ensures your uploads are secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*L1x7vdG0WdkA4padVo3dmg.png" /></figure><p>To actually upload your archive, first generate the distribution archives with the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRiW52sMHG6ugaDpFPM83g.png" /></figure><p>There are ways to debug that your package will be uploaded properly using <a href="https://test.pypi.org/">TestPyPI</a>, a separate index meant to facilitate the testing module uploads— the python documentation has an excellent tutorial on this exact process <a href="https://packaging.python.org/tutorials/packaging-projects/">https://packaging.python.org/tutorials/packaging-projects/</a>.</p><p>Now that your package is published, you can easily pip install it: pip install my_cool_function</p><h3>Maintaining a Module</h3><p>When maintaining a python module (or <em>any</em> code, for that matter), you should automate as much of the work as possible. While we can’t really automate writing a module (at least not <em>enti</em>r<em>ely</em>), we can automate its integration and deployment. If you aren’t practicing rigorous Test-Driven Development (TDD), the long-term correctness of your code is dependent on automated testing. Discussion on effective testing is beyond the scope of this article, but there are lots of ways to test your code — my recommended solution is <a href="https://docs.pytest.org/en/stable/">pytest</a>.</p><p>In the spirit of developing shared code, I have a starter repo called <a href="https://github.com/AumitLeon/module_starter_cli">module_starter_cli</a> that comes preconfigured with all the necessary infrastructure to automate testing via <a href="https://docs.pytest.org/en/stable/">pytest</a> , versioning and publishing through <a href="https://python-semantic-release.readthedocs.io/en/latest/">python-semantic-release</a>, and deployment through CircleCI. Forking this repo for downstream module projects gives you the ability to run automated tests on every branch for every pull request, and will automatically version your code and handle the hassle of deployment to create a seamless and low friction development cycle. I can go into detail on this setup and the philosophy behind shared infrastructure code in a future article. Till then, I hope this article helps your solutions become a little more generalizable.</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b38026a51665" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/publishing-python-modules-b38026a51665">How to Publish Python Modules</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contributing to Open Source]]></title>
            <link>https://aumitleon.medium.com/contributing-to-open-source-387ccdc0fe5c?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/387ccdc0fe5c</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Sun, 15 Nov 2020 06:00:21 GMT</pubDate>
            <atom:updated>2020-11-15T18:29:06.291Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5mQ7fEbL70y3C8tqjH66g.png" /><figcaption>Maybe not always fun, but certainly fulfilling.</figcaption></figure><p>“Open source” is one of the oldest buzzwords in software. Unlike other software buzzwords, however, open source has remained relevant for almost 30 years — almost every major modern software package uses open sourced components in some form or function. The invaluable work of open source contributors has propped up some of the most important pillars of our digital infrastructure — ranging from <a href="https://www.linux.org/">GNU/Linux</a>, the operating system that runs <a href="https://w3techs.com/technologies/overview/operating_system/all">68% of all web servers</a>, to <a href="https://wordpress.org/">WordPress</a>, the content management system that powers <a href="https://w3techs.com/">approximately 31% of all websites</a>.</p><p>Before proceeding, I think it’s important to clear up what this article is and what it isn’t. This article is not meant to laud the auspices of open source or talk about why <a href="http://www.catb.org/esr/writings/cathedral-bazaar/">the bazaar is superior to the cathedral</a>. In fact, I personally believe that there are many flaws in the modern open source methodology, some redeemable, others not. That doesn’t change the fact that open source is ubiquitous. As a creator and consumer of software, you have (or inevitably will) benefit from open source work — work that is often done for free. This article captures my personal experience in getting started with open source and aims to shed light on how others might do the same.</p><h3>Finding a Project</h3><p>The most difficult part of contributing to open source is finding a project that is worth contributing to. This criterion is different for every individual, and this is part of the reason why open source has thrived for so long — developers have a wide enough range of interests that even the most niche open source projects will have users and staunch supporters. However, in personal experience, interest alone was never enough to spur a serious contribution. There have been plenty of projects that have piqued my interest, and yet, contributing to those projects always seemed intimidating and out of reach — a feeling I suspect many coders experience when making their initial foray into the world of open source.</p><p><strong><em>The best projects to contribute to are those that you actively consume.</em></strong> If you are actively using a software library, you are an ideal contributor because you have intimate knowledge of what that project does and how it functions. Simply being interested in a project lacks the inherent experience component that makes contributing to open source approachable. The more you use a project, the more likely you are to find a need within that project — this could come in the form of a documentation tweak, a patch, or some other sort of contribution to the wider community.</p><p>The more code you write, the more projects you’ll come to consume, and as a result, the more open source contribution opportunities that you’ll find. At Indigo, we recently shifted towards a set of observability tools that includes <a href="https://www.elastic.co/apm">Elastic Application Performance Monitoring</a> (APM). Many of our internal APIs are written in python, which meant that the <a href="https://github.com/elastic/apm-agent-python">python version of the Elastic APM agent</a> would see heavy usage in many of our repositories. My team was an early adopter of the Elastic APM within Indigo, and I got a lot of hands on experience with the python agent. While assessing our needs, it became clear that there was a key feature that we needed that didn’t currently exist in the python agent — I viewed this as an opportunity to drive value for our organization as well as the wider community of users around the Elastic APM python agent.</p><p>When you’ve identified a change you’d like to see in a project (either a bug fix, feature), it helps to first look at the list of <a href="https://guides.github.com/features/issues/">issues</a> in the project to see if other users of the project are talking about the changes you have in mind. If you do find an existing issue, the conversation in that thread could help you find work-arounds or learn about any existing work around resolving that issue. This is a great way to build context and develop an understanding of the state of the project and how your envisioned changes fit in.</p><p>If you don’t find an issue, create one yourself! Opening an issue creates an initial dialogue between yourself and a project’s maintainers and engaged users — this dialogue can provide invaluable context. For example, the maintainers might illuminate some technical nuance that might serve as a prohibitive blocker for your suggestions, they might point you towards active work around the idea you proposed (usually the case of duplicate issues), or they might be able to provide support in some other way. In any case, the foundation of an effective open source community is <em>communication</em>, and opening an issue describing the problem is always a great way to develop rapport with project maintainers and make impactful contributions.</p><h3>Proposing Changes Via Pull Requests</h3><p>After you open an issue and (hopefully) get some feedback, the next step is to take a crack at implementing your feature or bug fix by creating a <a href="https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests"><em>pull request</em></a>. Pull requests are how you get your changes merged into the original codebase. For most open source projects (at least those hosted on GitHub), you need to create a <a href="https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo"><em>fork</em></a> of the project you wish to contribute to and make your changes to a feature branch within your fork. After your changes are ready, you open a pull request to the original project with the intent to merge your fork’s feature branch into the main branch of the original project. This process is nicely summarized by this post on <a href="https://guides.github.com/activities/forking/">how to fork repos</a>, and this post on <a href="https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork">how to create a pull request from a fork</a>.</p><p>Many open source projects will have a suite of tests that your code needs to pass before your changes can be considered for a merge. Effective tests are the cornerstone of any sustainable codebase — they help ensure any changes in code don’t break any fundamental assumptions or functionality. Well written tests also serve as a form of documentation — good code is often self-documenting, and this sentiment extends to good tests. Make sure to pay special attention to test cases surrounding your code changes (a fully passing test suite is just the first step towards deploy ready code), and add any additional test cases that are necessary to cover the changes you made (your goal is to improve a project through your contribution, and untested code is akin to technical debt).</p><p>Before your changes can be merged, you need to receive approval from the project’s maintainers — a process that varies project to project. It’s important to remember that many maintainers have day jobs, families, and lives outside of open source. They often contribute to these projects in their spare time, so exercising a little patience and courteousness goes a long away. <br>Depending on the scope of the changes in your pull request, the maintainers will typically provide you feedback and guidance towards on additional changes you should make before they can approve your request, or they will provide an immediate approval if things look good from their perspective. Feedback typically comes in the form of comments on the pull request, which allows the pull request to serve as a living record for all the conversation that went into a particular change. After your PR gets approved, you’re good to go! A maintainer will eventually merge your changes, and the project will have benefited from your work.</p><h3>Conclusions</h3><p>Contributing to open source is much more approachable and enjoyable when contributing to projects that you actively consume. It’s important to remember that no change is too small. My first open source contribution ever was a <a href="https://github.com/rtfd/readthedocs.org/pull/4508">correction to the documentation on build processes</a> for <a href="https://docs.readthedocs.io/en/latest/index.html">Read the Docs</a>.</p><blockquote><a href="https://www.igor.pro.br/publica/papers/saner2016.pdf">28% of casual contributions</a> to open source are documentation, such as a typo fix, reformatting, or writing a translation.</blockquote><p>Your changes can be as small as fixing a typo, or as large as an entire feature — the scope is entirely dependent upon you and what you want to take on. My personal contributions were bore out of necessity — I was building something else, and along the way, I discovered a bug in some piece of software that my project depended on.</p><p>There are, of course, other ways to contribute, but I’ve found that the best way to contribute to open source is to keep on using open sourced software — you’ll inevitably find ways to contribute.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=387ccdc0fe5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging AWS to Scale R&D Workflows]]></title>
            <link>https://medium.com/indigoag-eng/leveraging-aws-to-scale-r-d-workflows-a200ffbf8ed6?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a200ffbf8ed6</guid>
            <category><![CDATA[indigo]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Mon, 07 Oct 2019 18:08:33 GMT</pubDate>
            <atom:updated>2019-10-07T18:08:33.387Z</atom:updated>
            <content:encoded><![CDATA[<p>In order to identify and deliver commercially viable products for our growers, Indigo’s Research and Development teams analyze bacterial and fungal microbes through bioinformatic analysis tools at scale. In order to deliver the scalability and efficiency required to support the high throughput nature of Indigo’s R&amp;D pipelines, the Biomation team has built out cloud native solutions through AWS.</p><p>The tools that Biomation builds infrastructure around are written by Indigo’s data scientists, usually in the form of python modules. These tools require varying amounts of compute resources, making it difficult and highly inefficient to run these pipelines locally. Difficult because every tool requires special setup within whatever local environment they’re running from (specific binaries, configurations, etc), and inefficient because compute resources are limited to a single machine. In building out cloud infrastructure for our bioinformatics tools, we are able to scale with workloads as necessary, ensuring that jobs run as efficiently as possible while removing the technical overhead of configuring tools to run on any specific machine.</p><p>We have a set of tools used by our R&amp;D scientists known as the Genomic Pipeline. Microbes are passed through this pipeline after undergoing whole genome sequencing. This pipeline preps microbes for further research and analysis for what will eventually become commercial products. The individual tools that comprise the Genomic Pipeline are python scripts, some packaged as python modules for programmatic access. For each tool, we developed a microservices architecture that ensured <em>scalability, usability, and efficiency.</em></p><h4>Architecting R&amp;D Tools</h4><p>At the macro level, Biomation needed a way to build an architecture around the python tools produced by Indigo’s data scientists that would increase the number of microbes that could run through the Genomic Pipeline. At the micro level, this meant ensuring that the tools were easy to use for our scientists, had the scalable flexibility to deal with many microbes at once, and the composite efficiency of providing easily accessible results in a timely manner. At Indigo, we like to move fast, so making the pipeline as efficient as possible was and still remains a high priority.</p><p>In order to make the pipeline easier to use, we obviated the need for local installations and configurations by running the python scripts within Docker containers. This lent us several advantages, chief among them, only having to manage dependencies and various bioinformatic binaries for a single, portable environment. Each tool had its own Dockerfile that managed installing the dependencies required to run that tool successfully; when a container was spun up with the image generated by that Dockerfile, the python tool running in that particular container would always have its necessary dependencies. All of our Docker images and containers were ported to AWS Elastic Container Registry (ECR), a central repository for our images in the cloud.</p><p>While Docker containerization helped manage wrangling dependencies, we still needed a way to run these containers in an environment that could scale with our workloads. AWS Batch provided the solution for this problem. Batch lets you define a compute environment with certain parameters and manages the overhead of spinning up compute resources as you submit jobs to the Job Queue. The compute resources spun up by Batch are AWS EC2 instances — the type of instance provided by Batch for a particular job is specific to that job. Jobs that require more compute resources will run on instances that can accommodate that need, all within the bounds of the parameters set in your Batch compute environment.</p><p>With Batch managing compute resources and ECR holding our images, we had a cloud native, microservices architecture paradigm that could be applied to all of our tools. Even better, all of our cloud infrastructure could be managed as code via AWS CloudFormation and we’d have sufficient logging made available by AWS CloudWatch.</p><p>So when a user initiated a job as part of the Genomic Pipeline, that job was passed to our Job Queue which would await the allocation of a compute environment by Batch. When Batch provided a job with a compute environment, the container with the Docker image associated with the tool that the user was attempting to run was pulled down from ECR and ran on that compute environment. Inputs from the user were surfaced to the container as environment variables. After the job completed running, relevant output files got synced to S3 and data was synced to our Snowflake databases via Lambda functions.</p><p>Thus, users didn’t need to worry about managing compute environment or dependencies; they could expect to have the relevant output files from their analysis synced to a predictable location in S3 and the data associated with any job made available for further analysis through our database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GEAV3461U2-6wfOmylkjfQ.png" /><figcaption>Cloud architecture for individual R&amp;D tools.</figcaption></figure><p>This was the pattern we used for each step in our Genomic Pipeline: every tool had a Docker image that managed dependencies, that tool would run on a compute environment provided by Batch, and relevant outputs were made easily accessible for users. This was a highly efficient pattern that improved the overall throughput of our R&amp;D pipelines. Before we built this architecture around the Genomic Pipeline, only 30 or so microbes would make it through the pipeline in a given quarter. After, we were consistently running hundreds in the same time period.</p><h4>Shortcomings</h4><p>While our new architecture was highly efficient, all software can be iterated on and improved. In keeping with a microservices architecture, each of our tools was an isolated python module or script, and they each ran in their own compute environments as Batch tasks. The problem with this paradigm was that the Genomic Pipleine is comprised of a finite set of tools that often need to be run in sequence. So while our users would run individual tools in the pipeline in isolation, the most common use case required running each tool in sequence.</p><p>While this was completely possible within the confines of the architecture we built out, it often meant additional overhead and cognitive load on our users: before invoking downstream tools, the users themselves would need to gather necessary inputs and manually execute jobs in sequence. We noticed that this was something that could be automated: if a user wanted to run the steps of the Genomic Pipeline in sequence, which was often the case, the overhead of ensuring that intermediate inputs and outputs were in the correct place should be handled automatically. In addition, users should still have the capability of running individual steps of the pipeline in isolation, without triggering downstream steps.</p><h4>Step Functions and State Machines</h4><p>Each step in the Genomic Pipeline is run as its own Batch task when triggered by the user. We needed a clever way to orchestrate Batch tasks so that users could simply specify what step in the pipeline they want to start and end at, without having to manually trigger each job. AWS Step functions provided a convenient solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5Kha2BQAMkDno5F_3TE2A.png" /><figcaption>Genomic pipeline step function architecture.</figcaption></figure><p>Step Functions allow you to define a state machine graph that maps to your exact workflow. We used Step Functions to define a state machine for the Genomic Pipeline, such that each state in the State Machine graph was a step in the pipeline. The Genomic State Machine, defined by our Step Functions, orchestrated our Batch tasks in a way that allowed users to specify a start state and end state, while handling the overhead of transitioning between intermediate steps in the pipeline deterministically.</p><p>We still had the same benefits of our overall cloud infrastructure: CloudFormation allowed us to manage our infrastructure as code, CloudWatch provided logging, S3 provided file storage, and Batch managed compute resources.</p><p>In addition to existing benefits, orchestrating our pipeline using Step Functions provided us additional benefits as well. Whereas we needed to manually keep track of errors between the steps of the pipeline as individual Batch tasks in the past, Step Functions have built in error handling that manages errors within your State Machine graph. This was especially convenient for us because if a job failed at a particular step in the pipeline, we wanted to catch that error, sync intermediate results and data to S3 and Snowflake to be made available to our users, and then fail gracefully.</p><p>Step Functions also allowed us to redefine what it meant to be a step in the Genomic Pipeline. We noted that some steps in the pipeline were actually composed of multiple substeps. Before the state machine, when users would manually trigger individual steps of the pipeline, this meant that Batch would provide a task with an EC2 instance with the minimum number of CPUs required by that particular step. For tools in the pipeline composed of multiple substeps, this meant running on an EC2 instance with as many CPUs as required by the most computationally expensive substep of that tool, no matter how short that particular step was. Our state machine definition made it easy break steps into substeps such that each state’s Batch task received only the compute resources it required. So instead of paying for a large instance which was only used to its full potential for a fraction of the total time it was running, our state machine definition ensures that Batch gives us EC2 instances that are used more efficiently. Optimizing our use of compute resources reduced our costs without hurting the efficiency of the overall pipeline.</p><p>In reducing individual tools into component substeps through Step Functions, we are also able to reduce bloat in our Docker containers. Each substep has its own Dockerfile, which only specifies the dependencies necessary to run that particular step. When tools were triggered and run in isolation, the Dockerfile for a given tool in the pipeline had to account for all the dependencies required for each substep in that particular tool — this was highly inefficient and often made it difficult to update individual dependencies or debug complicated tracebacks relating to interconnected dependencies. Step Functions allowed us combine isolated tools with an orchestration layer.</p><h3>Conclusions</h3><p>A key priority of our team is to provide cost effective solutions that can help automate and increase the throughput of Indigo’s R&amp;D pipelines. We’ve used AWS cloud infrastructure to help us scale our workloads and provide tools that increase the overall efficiency of our end users — Indigo’s scientists. In the pursuit of improving the tools we’ve built, we’ve found Step Functions to be an effective way to orchestrate Batch tasks and deterministically handle jobs that must run in sequence. Our users can now to run hundreds of microbes through the Genomic Pipeline <em>each day</em>. We’re continuing to improve our pipeline, tooling, and infrastructure — if working on scalable genomic analysis and automating bioinformatics workflows is interesting to you, we’d love to chat. We’re hiring!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a200ffbf8ed6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/indigoag-eng/leveraging-aws-to-scale-r-d-workflows-a200ffbf8ed6">Leveraging AWS to Scale R&amp;D Workflows</a> was originally published in <a href="https://medium.com/indigoag-eng">IndigoAg.Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning About Design Patterns in Software]]></title>
            <link>https://aumitleon.medium.com/learning-about-design-patterns-in-software-bee286ecdd3a?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bee286ecdd3a</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 18:03:35 GMT</pubDate>
            <atom:updated>2019-09-02T18:13:25.789Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuNrt3UwQSiuLiD8sw5Hcg.jpeg" /></figure><p>One of the most effective ways to develop your skills as a Software Engineer is by familiarizing yourself with design patterns. You might have some understanding of patterns that already exist from projects you’ve worked on or used, but the mark of an effective problem solver is a deep and insightful repertoire. A deep repertoire ensures that you as an engineer arrive at the best fitting solution for a given problem. It’s often the case that an engineer will apply one generalizable solution to a wide suite of problems — while this might solve the immediate problem, if this solution does not account for the particular nuances associated with the problem at hand, the solution will fail to scale, produce technical debt, and almost certainly cause growing pains down the line that might influence a costly redesign. With an understanding of why we should build our knowledge of design patterns, how does one go about building such a repertoire?</p><p>The first thing to understand is that such a repertoire is never complete. Technology constantly evolves, and effective engineers take the time to learn new design patterns and incorporate these patterns in the software they build. Because change is constant, we as engineers are constantly looking to understand the best ways to design and build software — an exhausting process, but one that underlies the intellectual vigor of our profession. In the truest sense of the phrase, developing knowledge about design patterns is almost entirely about the journey, and not the destination.</p><p>While I have been programming for many years, my body of work on large scale, production ready systems is relatively small. Thus, while I do have an understanding of some design patterns, I still have much to learn. In order to develop my understanding of differing architectures and design philosophies, I’ve consulted a few resources that have helped shape and further my learning. Among them, exploring the architecture of open source projects, building out small mocks using new technologies, and most importantly, posing questions to my mentors — the more experienced engineers in my life.</p><h4>Exploring the architecture of open source projects</h4><p>Open source projects are an excellent way to understand unfamiliar design patterns. Popular projects are tried and true, and you can be sure that the patterns established within these projects can potentially be used for other projects you might end up working on. This won’t be the case for every open source project you come across — many have patterns built specifically for the need that project was designed to address, but understanding these patterns will only benefit future design work you undertake. I’ve personally explored how to build python modules effectively, integrate test suites with strong coverage, and refine CI/CD pipelines by exploring open source projects on Github. Finding open source projects that are worth exploring is a challenge in and of itself. While some argue you should just pick something that’s interesting to you, I never found that advice to be very useful. The first thing to understand when beginning to explore open source is that it’s everywhere. Almost everything you touch is built on some type of open source software. The best projects to explore are those that you actively consume — you already understand how they are used, so the learning curve is less steep. Exploring projects that you actively use will also enlighten you to the implementation and design details that make a piece of software <em>useful</em>, by your own definition.</p><p>In addition to actually exploring open source projects, I’ve found books to be a refreshing way to learn more about design patterns. In particular <a href="http://aosabook.org/en/index.html"><em>The Architecture of Open Source</em> <em>Applications</em></a> is an excellent resource on learning about the design decisions that underlie some of the most widely used and and powerful open source projects out there. Trying to learn from open source can be like drinking from a fire hose — I’ve found it helpful to learn as much as I can from as many diverse sources as I can.</p><h4>Building out Mocks and MVPs</h4><p>Learning is active, not passive. Reading about and exploring other people’s code is helpful, but actually solidifying ideas and concepts in your brain is made possible by building things. While trying to learn new patterns and paradigms, I’ve taken to building out small mocks and minimum viable products to test existing ideas and experiment with new ones. These projects are often low risk (I’m the only one that will ever see them), and have high educational value. A well built mock or MVP can be used as a type of starter project for downstream work that might need to borrow from the foundations laid in this initial experimentation.</p><p>These mini projects can take any form you like, and it is completely up to the engineer to determine the level of detail they’d like to commit to a particular body of work. What’s important to remember while working on these projects is that they are not meant to be inherently scalable or production ready — they are there to help you build scalable and production ready software more efficiently down the line.</p><h4>Mentors</h4><p>The single, most powerful piece of my learning has been having brilliant and talented engineers as mentors. Collectively, they’ve worked at large and small organizations, hundreds of projects, and have written thousands of lines of code — the benefit of their experience has made me a better programmer, and more importantly, a better person. Far more than learning in a vacuum, leveraging formal and informal networks will accelerate learning and provide you with a large number of opportunities to grow your skills. In our profession, I believe mentorship is essential. Design patterns are abstract by nature and highly difficult to understand — learning from others can help you identify the solid steps necessary to actually implement a new idea or identify a situation in which some paradigm will be most useful.</p><h4>Conclusions</h4><p>Being able to effectively identify a design paradigm that will best suit the needs of a particular problem will help you build better software. Improving your skills by learning new ways to build and architect software is one of the best ways to continue to ensure that you’re growing as an engineer, and shipping better code as a result. These lessons are applicable to engineers at all levels — no matter your seniority, there is always an opportunity to learn something new. If there wasn’t the opportunity for constant growth and room for intellectual curiosity, software engineering would not be a worthwhile endeavor. We’re lucky it is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bee286ecdd3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating Deep Neural Networks]]></title>
            <link>https://aumitleon.medium.com/accelerating-deep-neural-networks-7593fcdfd54c?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7593fcdfd54c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[deep-neural-networks]]></category>
            <category><![CDATA[thesis]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Sat, 10 Aug 2019 03:05:21 GMT</pubDate>
            <atom:updated>2019-08-11T17:23:01.844Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A retrospective on my undergraduate thesis work in Computer Science at Middlebury College.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*JIc6sFKZHmhLn_BlDBGhxA.png" /></figure><p>As part of my undergraduate thesis work, I explored the how deep neural networks (DNNs), particularly <a href="http://cs231n.github.io/convolutional-networks/">convolutional neural networks</a>, could be accelerated via parallelization. The full text of my thesis can be found <a href="https://aumitleon.com/assets/projects/leon_thesis_spring2019.pdf">here</a>. Writing this thesis allowed me to focus on an area of machine learning that I find incredibly interesting:</p><blockquote><strong><em>How can machine learning methods such as DNNs scale in a way that facilitates training increasingly complex models on less powerful hardware?</em></strong></blockquote><p>DNNs are <a href="https://blog.ycombinator.com/jeff-deans-lecture-for-yc-ai/">wildly popular</a>, to the point of becoming a buzzword. Deep learning methods have been successfully applied to a range of tasks, including <a href="https://ieeexplore.ieee.org/document/8632885">speech recognition</a>, <a href="https://deepmind.com/research/case-studies/alphago-the-story-so-far">superhuman game playing</a>, and <a href="https://pjreddie.com/media/files/papers/YOLOv3.pdf">visual recognition tasks</a>. Scaling DNNs to work on less powerful hardware would yield several important benefits.</p><p>For starters, a small subset of people interested in problems surrounding DNNs have access to a large compute cluster of GPUs to train their models, like the one used to train <a href="https://www.nature.com/articles/nature16961">AlphaGo</a>. Being able to train these methods on less powerful hardware is possible if we can effectively increase the efficiency of these model’s usage of compute devices. By making better use of less powerful hardware, DNNs can be democratized in a way that allows a wider range of engineers, data scientists, researchers and machine learning enthusiasts to develop more complex and powerful models that can challenge the status quo and redefine the state-of-the-art. A diversity of perspectives is necessary in machine learning, especially as the field comes <a href="https://www.theguardian.com/technology/2019/apr/16/artificial-intelligence-lack-diversity-new-york-university-study">under fire for perpetuating biases in various applications</a>. The wider software industry continues to see the benefits of this form of democratization — software engineering was once restricted to those who had access to powerful computers, but as computers became cheaper and more accessible and more people were able to contribute to the field, the quality of our software increased.</p><p>The ability to train DNN models on less powerful hardware implies that researchers can also build larger, more complex models than ever before. While the addition of more layers or the use of more features may not necessarily yield more than an incremental improvement on existing methods, optimizing the use of compute resources such as GPUs and specialized hardware such as TPUs and FPGAs while training DNNs allows researchers to explore a wider range of model architectures. Optimizing the use of our tools is still an open problem in computer science and information systems— <a href="https://www.technologyreview.com/s/611482/the-productivity-paradox/">in 1987 Robert Solow won the Nobel prize for describing the relationship between innovation and economic growth</a>. Solow would tell the New York Times, “<em>you can see the computer age everywhere but in the productivity statistics.</em>”</p><p>In the 1980s, technological innovation was soaring but workplace productivity was stagnating. Solow described this productivity paradox as a function of companies failing to effectively adopt and optimize their use of emerging technologies. The same principles can be applied to the nascent field of deep learning: we have to make better use of hardware innovations (particularly around GPUs) in order to increase the effectiveness of DNNs and related methods.</p><p><strong><em>How, then, do we make better use of hardware innovations?</em></strong></p><p>For the 10 weeks that I had to work on my thesis, I explored methods that accelerated the training of DNNs via parallelism. Optimizing the use of compute devices such as GPUs during training would naturally lead to shorter training times.</p><p>I chose to focus my research on image recognition tasks. It’s easy to get lost in the breadth of fields where deep learning methods are increasingly defining the state-of-the-art, but I wanted to dive into the depths of a particular application. Image recognition was a natural choice primarily because <a href="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf">AlexNet’s</a> performance on the <a href="http://image-net.org/challenges/LSVRC/">Large Scale Visual Recognition Challenge</a> was one of the first successful, breakthrough applications of deep learning.</p><p>The Large Scale Visual Recognition Challenge was a competition built around <a href="http://www.image-net.org/">ImageNet</a>, a dataset of over 14 million labeled images. As the winner of the competition in 2012, AlexNet was a serious display of the power of deep learning methods. My research focused on the ways in which the convolutional neural network architecture of AlexNet could be parallelized during training. I focused on <em>data parallelism, model parallelism, </em>a hybrid method specifically designed for AlexNet known as the <em>One Weird Trick (OWT) </em>method<em>,</em> and a generalizable frameworks called <a href="https://github.com/flexflow/FlexFlow"><em>FlexFlow</em></a><em>.</em></p><h4>Parallelism Methods</h4><p><em>Data parallelism</em> splits equal sized subsets of the data across each compute device. After the training algorithms are applied to each subset on each device, the results are aggregated between training epochs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76Ig5FF1dsx5AtHWSXfoFQ.png" /><figcaption>Data Parallelism</figcaption></figure><p>Thus, if you have 300,000 data points and 3 GPUs, each device would would run a full replica of the model architecture on 100,000 of the data points before aggregating the results.</p><p>In contrast, <em>model parallelism </em>splits the model architecture itself across each available compute device, and runs the full dataset through each device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*is9H4mETy8e80pujz0jp-Q.png" /><figcaption>Model Parallelism</figcaption></figure><p>By splitting the model architecture across the compute devices, each device is responsible for an equal sized subset of the total weights matrix. If the weights matrix is <em>900 x 900</em>, each GPU is responsible for <em>900 x 300 </em>weights from the matrix. Similarly, all the intermediate results are aggregated.</p><p><a href="https://arxiv.org/abs/1404.5997">Alex Krizhevsky’s <em>OWT</em></a> is a hybrid method that combines model and data parallelism specifically for the AlexNet architecture. In particular, OWT uses data parallelism for fully connected layers, and model parallelism for convolutional layers.</p><p>Data and model parallelism are generalizable methods that can be applied to a wide range of neural network architectures, but OWT was designed specifically for AlexNet. FlexFlow was the model agnostic, generalizable parallelization framework that I explored — in the literature, <a href="https://arxiv.org/abs/1807.05358">FlexFlow was shown to out perform data and model parallelism, as well as OWT when testing with AlexNet trained on the ImageNet corpora.</a></p><h4>Parallelism and Deep Learning</h4><p>Among the methods I implemented on my own, I found that the OWT method exhibited stronger performance when the input data more closely matched ImageNet’s images, particularly in size. The nuances of why one method performs better than another are still an open question for me, and something I plan on spending more time exploring. To read the details of my experiments and my analysis, refer to my full thesis.</p><p>In the spirit of democratizing machine learning methods, I believe that generalizable frameworks are the future of the field. Not only do they outperform general methods like model and data parallelism, they have also been shown to out perform model specific, expert designed methods, such as OWT. These frameworks are are extensible and takeaway the overhead of deducing a parallelization strategy that optimizes the use of compute resources. With more research and open source contributions, frameworks like FlexFlow can help build the next generation of state-of-the-art deep learning methods.</p><h4>Conclusions</h4><p>Parallelization methods are a powerfully effective way to optimize overall device usage during model training. By parallelizing computation during training, DNN training times are reduced, which enables the development of larger, more powerful models. While various parallelism methods exist, generalizable frameworks are the most effective and efficient tools available to researchers right out of the box.</p><p>Parallelism should be baked into the APIs we use to build machine learning models. No matter the API, be it TensorFlow, PyTorch, Keras, or the new flavor of the month, these tools should be built with parallelism in mind. Most APIs do a decent job of supporting general use cases out of the box, but truly efficient device usage via parallelism requires additional overhead. In the same way that programming languages and constructs lowered the barrier of entry into software engineering and improved the overall quality of all software in the process, parallelism enabled tools and efficient device usage will improve the quality of deep learning methods while making machine learning research more accessible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7593fcdfd54c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full Stack JavaScript — Learning How to Build a Web Application]]></title>
            <link>https://aumitleon.medium.com/full-stack-javascript-learning-how-to-build-a-web-application-281778be769a?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/281778be769a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[full-stack]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Fri, 23 Jun 2017 03:18:11 GMT</pubDate>
            <atom:updated>2017-06-23T03:28:24.770Z</atom:updated>
            <content:encoded><![CDATA[<p>Several months ago, I sat at my computer and watched in disappointment as <a href="http://blog.parse.com/announcements/moving-on/">Facebook shut down Parse for good</a>. As someone who was just getting used to writing dynamic web applications, this was horrible news. Parse was a <em>backend-as-a-service</em>, and provided a streamlined process for developers to get their apps up and running very quickly. Complete with a robust relational database, Parse was the perfect tool for a student like myself. After Parse was officially shut down, I thought about looking into the open-sourced Parse server, but the ease that Parse provided in the past was gone.</p><p>I took this opportunity to learn some new skills: I would learn how to write full stack applications. I had prior experience with HTML and CSS, and Parse gave me some experience with working with a database and a RESTful API, but I didn’t have experience with much else. The first choice I had to make was what stack would I look into.</p><p>There are several schools of thought here — some people think you should jump at whatever stack/frameworks are most popular, others will tell you to get started with a framework supported by a language you are more familiar with. Personally, I took the latter approach (not to stay that the stack I ended up working with (MERN) is not popular). I think a good student and aspiring Software Engineer should try to familiarize themselves with as many technology stacks as possible — these skills add versatility to your technical repertoire and make you a much more valuable to whatever project you end up joining. Having some familiarity with JavaScript, I decided to dive into learning full stack development with JavaScript. This would be a starting point for me: after learning the general design paradigms that apply to all full stack application development processes, I planned on jumping to a Python based stack, and after that a Ruby based stack.</p><h3>Reducing the number of unknown unknowns</h3><p>Whenever I get started learning something new, one of the first things I do is <em>reduce the number of unknown unknowns</em>. You can’t come to a satisfactory solution with any problem until you identify all the variables that figure into the problem. Getting started with full stack development was an entirely new challenge, and it forced me to dive into unfamiliar territory. Choosing to begin with a JavaScript based stack meant that I at least had some syntactic familiarity with the code I was going to write, but full stack development meant I would need to combine what I already knew in new and challenging ways.</p><p>I am personally not a fan of sitting through an entire online course to learn a new framework or topic. I prefer to learn by doing — there is inherent value in struggling with a concept and drawing the connections on your own. It can be a more difficult and drawn out process, but I have personally found it to be very rewarding. Unless there are difficult mathematical concepts or strict theoretical foundations that need to be established, I’ve found that the best course of learning for myself is to force myself to <em>ask the right questions</em>.</p><h4>Asking the right questions</h4><p>In order to cut down on what I needed to learn to develop dynamic applications, I needed to ask questions that could help reduce the number of unknown unknowns. Before I could get to building out a full fledged application, I needed to know what I didn’t know. A good place to start is figure out what you do know, and then fill in the gaps of your knowledge.</p><p>I was already familiar with HTML, CSS, and JavaScript, and I had experience building out static websites — so I had some background with basic front-end development. What I didn’t know how to do was spin up my own server, my own database instance, and how to connect it all to my HTML page. I researched some popular JavaScript based stacks and came upon the MERN stack — MongoDB, Express, React, and Node.js.</p><p>The MERN stack was a perfect starting point for me, mainly because I did have some experience working with Node.js. I first turned my attention to writing server side code with Node.js, and figuring out how Restful API’s work. I found a ton of awesome online resources, and I learned a lot about why Node.js is so popular these days. Freedom to interface with a server in anyway you want is a powerful asset for any framework, and Node.js has an incredible community of engineers that complement it with useful libraries.</p><p>Spinning up a basic web server was a fairly trivial task (there are a plethora of tutorials online that can show you how to go about doing that), but what I wanted to figure out was how to utilize a RESTful API to communicate requests between by database and my client. After reading a bunch of articles and following along with some tutorials, I had a theoretical understanding of how this all worked.</p><p>My investigations into the RESTful API paradigm naturally brought me to Express routers as well as MongoDB and Mongoose schemas — the back-end was starting to come together. In order to make all of these concepts click fully, I felt like I needed to create something using these technologies. It was exhilarating to finally understand how web applications were served and how they functioned at their core. It also instilled in me a well earned respect for some of the largest and most popular web applications out there today — I can’t use a product without thinking about the way that it was built. Having done some thorough research on using Node.js, Express routers, and MongoDB, the last step was getting started with React.</p><p>The developers that maintain React have put together some awesome <a href="https://facebook.github.io/react/docs/hello-world.html">documentation</a> to help beginners find their bearings. It was difficult to get use to thinking about my interface designs via components, but now it comes quite naturally. In fact, I think it’s pretty cool that modularity and abstraction find there way to various parts of programming, including front-end design. After going through a few more tutorials, I was finally ready to build something of my own.</p><h3>A simple tutoring forum</h3><p>As a college student and Computer Science major, I’m a big proponent of attending tutoring hours. They are a great way to work through problems with other students and refine your problem solving abilities. I have found, however, that tutoring sessions can become fairly redundant for tutors: they might have to answer the same questions multiple times throughout a given week. This not only wastes their time, it’s inefficient, and in keeping with the spirit of Computer Scientists, I thought an automated solution could be of use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-GQxJySoymvkqlgpygA_Q.png" /><figcaption>Coursify, work in progress build.</figcaption></figure><p>I decided to build a tutoring forum with the MERN stack. It will allow students to post questions for tutors to answer — this will allow students to easily have their questions reach tutors without having to physically attend tutoring sessions. It will also allow students who don’t typically attend tutoring sessions to benefit from discussion that takes place online. In the future, I’d like for professors to have the opportunity to guide the conversations on these forum — this will allow them to supplement their lectures to make sure that discussions surrounding assignments are inline with the course goals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncEIB-3U0k79SZ9_xWv9pQ.png" /><figcaption>Coursify, work in progress build.</figcaption></figure><p>I imagine that students and tutors will both benefit from this forum — access to peer discussions on course content is an invaluable part of any college course experience — my hope is that this forum will help facilitate these important conversations.</p><p>Currently, the app is a work in progress. Basic features are up and running, and the UI is mostly figured out. I intend on releasing this forum for several lower-level Computer Science courses this coming Fall semester, and depending on reception, I’d like to be able to add other departments and courses for the Spring.</p><p>I also plan on releasing a more technical blog post on the details of the forum, and the engineering decisions that went into its creation.</p><p>If you would like to check out the forum, visit <a href="http://tutoring-forum.herokuapp.com/">http://tutoring-forum.herokuapp.com/</a></p><p>If you want to see the code: <a href="https://github.com/AumitLeon/tutoring-forum">https://github.com/AumitLeon/tutoring-forum</a></p><h4>Conclusion</h4><p>Learning about full stack development through the MERN stack has been an enlightening experience —in addition to experiencing other development stacks, I plan on learning more about systems and back end technologies. I am particularly interested in open sourced architectures, and data analysis via machine learning. Whenever I speak to recruiters, I love to ask them why the powers that be made the engineering decisions that they did— I think as a student and aspiring engineer, becoming familiar with these thought processes is an integral part of building great systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=281778be769a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DataFest 2017 — Increasing EXPEDIA’s Bottom Line: Leveraging Packages to Increase Commission]]></title>
            <link>https://aumitleon.medium.com/data-fest-2017-increasing-expedias-bottom-line-leveraging-packages-to-increase-commission-693f78bf990d?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/693f78bf990d</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Mon, 17 Apr 2017 05:49:31 GMT</pubDate>
            <atom:updated>2017-05-02T01:26:17.645Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*48OvWypcczf0wkwU2BeF8A.png" /></figure><p>Data science is a fascinating field, and engineers need a fundamental understanding of data in order to create more impactful platforms. Last weekend, my team and I entered the DataFest 2017 hackathon here at Middlebury — DataFest was our first forray into the world of Data Science, and allowed my teammates and I to exercise the skills we’ve refined in other domains (our team consisted of majors in Biology, Math, and Computer Science). Ultimately, we feel as though the diverse academic interests of our team culminated in a more thorough anlysis. This year’s data set was provided by Expedia and included data on millions of user sessions. Our goal as a team was to analyze the data and develop actionable items that Expedia could use to optimize revenue.</p><h4>Converting and Cleaning the Dataset</h4><p>When the dataset was released at around 6:30 p.m on Friday, it was given to us in a text file that was tab delimited. We wanted to acquaint ourselves with the data before we proceeded to clean and process it, so we converted it to CSV and opened it up on Excel.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7b7ecd076335116625cc1e4a678dcd7/href">https://medium.com/media/a7b7ecd076335116625cc1e4a678dcd7/href</a></iframe><p>Once we had the dataset converted (which was a fairly simple process in Python), we opened up the Excel file and checked out the names of various columns as well as the types of data that we were given. The column headers and data dictionary provided with the dataset gave a description of what each column represented — all the fields were very interesting, and they combined to form a very nuanced narrative of Expedia’s user sessions. Converting to CSV format was also very useful because it allowed us to see how the data was formatted — in particular, how fields with missing or erroneous data were handled. Our initial investigations showed us that such fields had the value ‘NULL.’ In order to make accurate visualizations and glean any valuable insight from the data, we needed to clean the data and correct any erroneous entries to stop anomalies from appearing in our analysis.</p><p>In order to automate the way we processed the data, we utilized the Pandas library in Python. We use Pandas data frames to clean and analyze the data — this was my first time exploring Pandas, but the documentation and online support for the library is very thorough, making it very simple to get started with right away.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8da1d3a12a174767620ec02affb6569/href">https://medium.com/media/c8da1d3a12a174767620ec02affb6569/href</a></iframe><p>In the process of cleaning the data, I removed duplicate entries and entries with ‘NULL’ columns, and then printed the shape of the data frame to confirm that the unwanted entries had been removed. A quick scan of the updated CSV also confirmed that the unwanted values had been removed.</p><h4>Focusing our Approach</h4><p>Now that we had a cleaned up dataset, we could focus our approach in order to paint a clearer picture of the data. We realized that the dataset included many different types of sessions, and within each session, the user had different preferences in terms of the number of adults and children travelling, the number of rooms booked, if the booking was part of a package deal, etc. After running some initial stats using the describe() function in Pandas, we had a general idea of frequency variations between columns.</p><p>Our intuition told us that the most common family compositions represented in the data would fall into 4 buckets: 2 adults, 1 room (a couple), 2 adults with 1–3 children, 1 adults with no children, and 1 adult with 1–3 children. After filtering the data, these family compositions proved to be the most recurring — representing over 70% of the data set. We proceeded to create sub-data frames — 1 for each family composition. Now that we knew which type of customers we wanted to focus on, we had to decide on what aspect of these sessions we could focus on in order to extract the most useful insight.</p><p>We hypothesized that within these four family compositions, there would be variations in terms of socioeconomic status. We further hypothesized that people from lower income areas would be a) travelling less (and thus, be underrepresented in the dataset) and b) travelling to lower star rated hotels because they are cheaper. The latter was confirmed by our analysis of the data — lower star rated hotels (1–3 stars out of 5) were underrepresented across all the family compositions. The former was confirmed after we set a proxy for income as a means of analyzing the data with an eye towards socioeconomic status.</p><p>Our proxy for income was the city from which the user booked the deal (assumed to be the home city of the user). We chose city as our proxy because we could easily merge our data frames with data for the mean income of the most represented cities in the overall data set and subsequent data frames. In selecting the cities that would serve as our proxy for income, we had 3 criterion: 1) they needed to be among the most represented in each data frame (in order to maintain the integrity of our analysis), 2)they needed to vary in terms of region, and 3) they needed to vary in terms of mean income levels. The final criterion would ensure that our analysis served the entire spectrum of income levels. Admittedly, cities are not the best proxy for income/socioeconomic status, but given the time constraints of the hackathon, selecting cities was the most time efficient option. Future work could focus more closely on specific locations in order to draw a stronger connection between location and income.</p><p>We selected 15 cities: New York, Los Angeles, Houston, Toronto, Chicago, Calgary, Brooklyn, San Francisco, Seattle, Miami, Vancouver, Montreal, San Jose, Denver, and Atlanta. Of these cities, San Jose had the highest mean income at $101,980, while Miami had the lowest income, at $46,946. We then merged this data with our data set to complete each of our data frames.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6241a180ac583d3f6c228fa7e7841f2d/href">https://medium.com/media/6241a180ac583d3f6c228fa7e7841f2d/href</a></iframe><h4>Analysis</h4><p>With our data frames completed, we now focused our attention on the interesting insights we could extract from these particular compositions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pk0O4gzJqCXVgt7CsX-p2A.png" /><figcaption>Package deals are more popular in lower income areas.</figcaption></figure><p>Using cities as a proxy for income, we can see that package deals are more popular in lower income areas: almost half the deals booked from Miami were package deals. Similarly, we see higher rates of package deals being made in Brooklyn and New York — both towards the median in terms of our income distribution. Notably, cities like San Jose and San Francisco — towards the higher end of our income distribution — tended to close much less package deals. It would benefit Expedia to maximize package deals since this would allow them to make sales at a higher volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*GBNCBuLLdvzElj0sJ6929Q.png" /><figcaption>Family composition 1 (2 adults, 0 children). Where are people from various income levels staying?</figcaption></figure><p>The above highlights two important ideas: lower star rated hotels are not very popular in general, but they are most highly represented in lower income areas like Miami, Denver, and Chicago. Interestingly, we can also see that people from higher income areas are staying in higher star rated hotels that are of a lower price category — in other words — they are getting better deals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*0ASvjDETHz7vFapUypdDEQ.png" /><figcaption>Family composition 3 (1 adult, no children). Where are people from various income levels within this composition staying?</figcaption></figure><p>Again, this graphic highlights that lower star rated hotels are not as popular, indicating that lower income people tend to travel less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*RNUGLlTNkSkAYknkhthGlQ.png" /><figcaption>Package deals are more popular among lower income travellers.</figcaption></figure><p>While higher star rated hotels are more popular, it is important to note people from lower income areas are booking less (as we hypothesized), and are also purchasing packages at a higher rate than people booking higher star rated hotels.</p><h4>Conclusions</h4><p>From our observations, it is clear that lower income to average income family compositions are booking packages more frequently than higher income compositions. Because of this trend, Expedia is missing out on the opportunity to market package deals at a higher volume to a significant portion of their customer base. We concluded that the development of higher end “premium packages” to be marketed to people from average to higher income levels would allow Expedia it optimize their revenue function. These premium packages could come in the form of higher rated hotels, nicer car rentals, and more expensive airfare.</p><p>For future analysis, it would be interesting to note where transactions take place, specifically — are people from higher or lower income areas booking more deals from their phones? And if so, how can we act on this knowledge to increase the volume of packages being sold? Correlating this data to our family compositions and package analysis would allow Expedia to invest more efficiently in mobile or web based marketing and technological infrastructure.</p><p>Overall, this was a very cool experience for our first foray into the data science world. We look forward to attending future hackathons and building even cooler things!</p><p>To check out our full presentation complete with all graphics, <a href="http://aumitleon.com/HiveMindAnalytics_Datafest2017.pdf">click here</a>, for the corresponding write up, <a href="http://aumitleon.com/DataFest_writeup.pdf">click here</a>.</p><p>All of our code is open sourced at<a href="https://github.com/AumitLeon/DataFest2017"> aumitleon/github/datafest2017</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=693f78bf990d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “Whys” Behind Taking Time Off]]></title>
            <link>https://aumitleon.medium.com/this-time-last-year-i-found-myself-in-a-position-similar-to-that-of-many-high-school-seniors-i-40e9ea5d6eff?source=rss-a24e73c0b8d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/40e9ea5d6eff</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[college]]></category>
            <dc:creator><![CDATA[Aumit Leon]]></dc:creator>
            <pubDate>Thu, 05 Nov 2015 04:11:53 GMT</pubDate>
            <atom:updated>2015-11-07T17:10:55.667Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Navigating the transition to college and beyond on your own terms.</em></strong></p><p>This time last year, I found myself in a position similar to that of many High School seniors — I was trying to balance my social life, school life, and college admissions responsibilities on a single plate. The burden was at times so great that I almost felt guilty hanging out with friends or taking time for myself. The extent of all the work I would have to do in the coming days and months always buzzed in my mind like incessant wasps, muddling my sense of purpose.</p><p>Of the most stressful things I was working on, the college admissions process was one of the toughest. In hindsight, taking painstaking efforts to present the best version of myself on paper taught me many things, but none more important than the fact I was far too obsessed with the numbers, statistics, and metrics. <em>No application, however thorough, can truly encompass all that makes an individual unique, intelligent, creative, and genuine.</em></p><h4>Why?</h4><p>Like many of you are, were, and will inevitably be, I spent so much of High School trying to be quantitatively great when I should have been trying to be a better friend, brother, son, and overall person. When all the applications were finally sent in and the Fall semester began to wind down, I spent a lot of time reflecting on why I put such an insane amount of energy, sacrifice, and effort into this entire process. The way I saw it, I worked hard my entire life to get good grades, so that I could get into a good college, which would then allow me to get a good job and make good money. It sounded like a solid plan on paper, but all of a sudden, this wasn’t enough.</p><p>It suddenly felt like I was on a race to nowhere, my ambitions lacked substance. At this point, I sent everything to the chopping board — I questioned why I dressed the way I dressed, why I attended the High School I attended, why I made the friends that I made, why I wanted to study CS, why my SAT score was what it was, among many other things. Some of these questions were quite silly and had easy answers, and some are still left unanswered to this day, but the lot of them have taught me that the most difficult questions in life often begin with “Why.”</p><h4>Big Decisions</h4><p>This time spent reflecting was a very strange period in my life, one that still continues to this day. If you would have sat down the sleep deprived version of myself from this time last year and told him that he would not be in college at this time the following year, he would have refused to believe you with the same stubbornness that made him believe that college decisions were actually indicative of one’s potential to succeed in life— that a rejection was reflective of a deficit in character. But when the decisions did come, one school in particular (spoiler alert, the school I ultimately select) gave me the opportunity to defer admissions for a single semester before beginning my collegiate career, an offer that seemed to stick in my mind for some time.</p><p>There are a number of factors that contributed to my accepting this opportunity (finances among them), but above all else, I felt like I needed some time away from school to get a better understanding of what it was exactly that I wanted out of life, let alone college. I wasn’t sure what I would do for my 6 months away from school, but I knew I wanted to make the most of it. As the summer flew by in a humid haze, I found myself in contact with a social media startup based here in NYC. We corresponded over email, talked over the phone, and eventually I found myself sitting in their office undergoing a technical interview (which was quite the experience in and of itself).</p><h4>Lessons Learned</h4><p>There is no experience like that of working at a startup. I’ve cherished every minute I’ve gotten to spend in the presence of such brilliant engineers and hackers so far, and have had the opportunity to sharpen both my technical and entrepreneurial skills. Under their mentorship, I’ve learned how to write cloud code, reverse engineer iOS apps, develop growth hacks, present to investors, and strategize and scale effectively. The decisions I make impact the company in many ways, so there is a lot of responsibility on my shoulders to, quite frankly, not fuck up.</p><p>My time away from school has done more than just make me a better engineer and entrepreneur, it’s also allowed me to spend even more time with my family, read more books, and pursue personal projects. I’ve been able watch my baby cousin speak her first words, I’ve flown through Orwellian classics and contemporary poetry, and I was even able to make a quirky version of the Window’s classic, <em>Minesweeper</em>. Hell yeah.</p><p>This time off has allowed me to take a closer look at my life and the values I hold dear, and as a result, the incessant buzzing of those wasps of uncertainty has been abstracted away. It’s now clear to me that I want to build things, particularly software, that will connect, impact, and inspire people. I want to indulge in my family, and take every chance to make the most of life, because in the end it’s always too short.</p><h4>Cartography</h4><p>It’s impossible, and always will be impossible to illustrate a measure of real passion within the confines of the college admissions process, purely because the underlying nature of this process deters that raw humanity. Now this doesn’t mean that the process is completely flawed (it is effective in some ways), it just means that you shouldn’t obsess over it.</p><p>In my time away from school, I’ve taken to <a href="http://ed.ted.com/featured/fFV0BAV1">John Green’s idea of viewing learning as <em>cartography.</em></a> Everyone maps out their own path, and creates their own adventures, and because I decided to veer off the well worn course, I find myself ready to take on the world (and college) with a renewed enthusiasm, sense of purpose, and even more importantly — an understanding of the “why” behind my convictions. I challenge you to have the courage to ask and answer your own “whys” before embarking on your own journey and creating your own map.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40e9ea5d6eff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>