<?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 Suresh Devalapalli on Medium]]></title>
        <description><![CDATA[Stories by Suresh Devalapalli on Medium]]></description>
        <link>https://medium.com/@sureshdevalapalli?source=rss-cfc12733636b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pll3kz2DYDMPZp9moOhr0A.jpeg</url>
            <title>Stories by Suresh Devalapalli on Medium</title>
            <link>https://medium.com/@sureshdevalapalli?source=rss-cfc12733636b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:27:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sureshdevalapalli/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[Scaling for Memory: Right-Sizing Containers on Azure for Memory Bound workloads]]></title>
            <link>https://medium.com/gaussian-solutions/scaling-for-memory-right-sizing-containers-on-azure-for-memory-bound-workloads-9b45631fd5a9?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b45631fd5a9</guid>
            <category><![CDATA[scaling-up]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cost-optimization]]></category>
            <category><![CDATA[cloud-native-geospatial]]></category>
            <category><![CDATA[memory-limit-workloads]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Sat, 19 Sep 2026 11:18:08 GMT</pubDate>
            <atom:updated>2026-09-20T05:02:35.130Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR.</strong> Standard cloud autoscalers scale worker count based on requests, queue depth, or CPU, assuming each job has similar resource needs. Our workload broke that assumption: memory usage depended on the size of each file being processed. So we built a memory-aware scaler with Azure Functions and Service Bus that starts one right-sized Azure Container Instance per message. This post explains why standard scaling fell short, how the design works, and what we learned the hard way.</p><h3>The workload</h3><p>As part of the Transportation Data Exchange Initiative (TDEI) infrastructure we built, we needed to handle workloads that scale with the size of the input. Users submit geospatial datasets, and our services process each one. <strong>Validation</strong> checks a dataset for structural and topological correctness, <strong>formatting</strong> converts it between formats, and <strong>quality-metrics calculation</strong> measures how good the data is.</p><p>These services have different logic, but they share one trait that drives everything else in this post: <strong>the memory a job needs depends on the size of its input file.</strong></p><p>The following chart shows how peak memory usage grows with the size of the input file.</p><p>Formatter profiling: peak memory usage vs. input file size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*YtfnWMiHAU7NFangvnLeZA.png" /></figure><p>Three properties shape the design:</p><ol><li><strong>Jobs are long-running.</strong> They take much longer than a typical web request. For example, the formatter can take up to 6 minutes for a 250 MB file. The work is not CPU-bound, so a machine with more CPU doesn’t help.</li><li><strong>Arrival is bursty.</strong> Long quiet periods are followed by several submissions at once. Keeping App Service instances running for those bursts would be an unnecessary cost.</li><li><strong>Size is known before the job starts.</strong> The input file size is available up front, so we can decide how much memory to give a job before it runs. That turns out to be the key to the whole design.</li></ol><p>That combination set our design goal: <strong>provision a machine that is just big enough for the job, run the job to completion, then decommission the machine.</strong> Nothing sits idle and nothing is oversized, so we only pay for the memory a job actually needs, for as long as it needs it.</p><h3>What makes a job memory-bound</h3><p>“Memory-bound” gets used loosely. We mean <strong>memory capacity</strong>: the working set has to fit in RAM, or the job fails. This is different from being limited by memory bandwidth or CPU. A CPU-bound job slows down when starved of CPU. A capacity-bound job gets killed by the out-of-memory (OOM) handler. Adding more replicas doesn’t fix that, because each replica still needs enough RAM for the whole input.</p><p>Algorithms tend to fall into this category when they need most of the input resident at once, so peak memory is a multiple of input size:</p><ul><li><strong>Whole-document parsing.</strong> Loading JSON or GeoJSON into an in-memory object tree often costs several times the file size.</li><li><strong>Graph algorithms.</strong> Connectivity and network validation need the full node-and-edge structure, plus adjacency data, before they can produce an answer.</li><li><strong>Spatial operations.</strong> Building spatial indexes and intersecting geometries across features.</li><li><strong>Joins, sorts and group-bys</strong> that don’t fit a streaming model.</li><li><strong>Deduplication and uniqueness checks.</strong> Hash sets over every ID or geometry seen.</li><li><strong>Cross-reference validation.</strong> Checking every reference against every definition needs both sides in memory.</li></ul><p>Contrast that with per-record transforms, hashing or encoding. Those stream through the data, memory stays flat as the input grows, and ordinary horizontal scaling works well.</p><p>The useful part is that the memory demand of a job is <strong>predictable from the input, before the job starts.</strong> File size is a decent proxy for it, so if we size the worker to fit the job, we don’t have to guess.</p><h3>Why standard autoscaling doesn’t fit</h3><p>Most Azure scaling tools, including KEDA scale rules, Container Apps replica scaling and App Service autoscale, are built to answer one question: <em>how many copies of this worker should be running?</em> They scale on signals like queue depth, HTTP concurrency or CPU. That works well when every unit of work costs about the same. It breaks down for us in three ways:</p><ul><li><strong>Uniform replicas.</strong> Every replica gets the same CPU and memory. To avoid OOM on the largest file, you size every replica for the worst case, and you pay for that memory on every small job too. Size for the median instead, and large files crash.</li><li><strong>Wrong signal.</strong> Queue depth says how many messages are waiting, not how much memory the next one needs. CPU is nearly irrelevant to a capacity-bound job.</li><li><strong>Memory metrics arrive too late.</strong> Scaling on observed memory pressure is reactive. By the time the metric moves, the process is often already dead.</li></ul><p>Here is how the options stacked up for us:</p><ul><li><strong>KEDA / Container Apps scale rules:</strong> no per-message sizing; scales to zero; risky on scale-in because a job may be cut off before it finishes. Every replica is the same size.</li><li><strong>AKS + KEDA:</strong> no per-message sizing; partly scales to zero; risky on scale-in. It also adds cluster operations overhead.</li><li><strong>Azure Functions (Service Bus trigger):</strong> no per-message sizing; scales to zero; cannot run jobs to completion because of memory and execution-time ceilings.</li><li><strong>Function App + ACI (what we built):</strong> per-message sizing, scale to zero and runs to completion. The trade-off is custom code that we own.</li></ul><h3>The approach: one container per message, sized to fit</h3><p>The idea is to stop treating the request queue as a signal for “how many workers” and instead treat each request as an order for a specific machine: sized to its input, used once, then retired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDr8cCmLmax7z2pVEOhb2A.png" /><figcaption>Simplified Architecture Diagram of the solution</figcaption></figure><p><strong>1. A function app manages the machines.</strong> An Azure Function looks at the pending requests, provisions a container for each one that needs it, and decommissions containers that have finished. There is no fleet to size or keep warm: the function creates capacity when work arrives and removes it when the work is done.</p><p>Each new machine is sized from the request’s input file size:</p><ol><li>Calculate the peak memory requirement of the algorithm.</li><li>Find the smallest container instance size whose memory meets or exceeds the value calculated in step 1.</li><li>Provision that container instance.</li></ol><p>Each machine is an Azure Container Instance (ACI), created with exactly the required memory and tagged with the request it was provisioned for.</p><p><strong>2. A request leaves the queue only when its job is fully done.</strong> Our jobs run for minutes, and every request must be handled to completion. So the function only <em>looks</em> at the queue (a read-only peek) and never removes anything. The container it provisions picks up the request and removes it from the queue only after it has finished processing. If the machine fails for any reason, the request is still in the queue, and the next run of the function provisions a fresh machine to retry it.</p><p>The queue is the record of what is left to do, so a crashed job needs no special recovery logic. It simply hasn’t been completed yet.</p><p><strong>3. Finished machines are shut down and decommissioned.</strong> Once a container has completed its work, the function deletes it. Nothing lingers, so cost tracks actual work.</p><p>Two guardrails keep this safe. A cap on concurrent containers bounds cost, and tags on each container let the function tell which requests already have a machine, so the same request is never provisioned twice.</p><h3>The hard parts</h3><p>The happy path is about a hundred lines of code. Nearly all of the real engineering went into what happens when the world doesn’t cooperate.</p><p><strong>Peeking doesn’t lock messages.</strong> We peek instead of receive, so the scaler never holds a message it can’t finish. The cost is that a message can vanish between the peek and the moment a container is ready: another consumer takes it, or it expires. To handle this, we re-check that the message still exists while the container is being provisioned, and again once provisioning succeeds. If the message is gone, we delete the container we just made.</p><p><strong>Duplicates.</strong> The scaler runs every minute and provisioning takes a while, so the same message shows up in consecutive peeks. Checking tags on existing containers, plus deduplicating within a single peek batch, stops us from launching two containers for one job.</p><p><strong>Orphans.</strong> A running container whose subscription has since drained is wasted money. We detect it from its tags and delete it.</p><p><strong>Knowing when a container is really done.</strong> We delete a container only when both its container state and its provisioning state are terminal, so we never delete one that’s still winding down.</p><p><strong>Fairness.</strong> One busy subscription shouldn’t starve the others. The first pass provisions at most one message per subscription, and the second pass fills any remaining capacity.</p><p><strong>The function timeout.</strong> The timer function runs under a 10-minute limit on the Consumption plan. Batch sizing and bounded parallelism keep a run from overshooting it.</p><h3>Results</h3><p><strong>Before.</strong> Each service was provisioned for the worst-case input and deployed on Azure App Service plans that ran around the clock. Because bursts are short and most files are far smaller than the worst case, the machines were mostly idle. Typical utilization sat around <strong>10%</strong>: only a tenth of the machine’s run time was doing real work. Put differently, we were paying roughly <strong>10x</strong> what the work actually required.</p><p><strong>After.</strong> With the scaler in place, machines exist only while a job runs and are sized to the job’s input. Costs dropped by about <strong>8x</strong>, cutting the client’s bill substantially.</p><ul><li><strong>Deployment:</strong> before, always-on App Service sized for the worst case; after, one right-sized container per job, removed when done.</li><li><strong>Typical utilization:</strong> before, ~10%; after, close to 100% while a job runs, with the machine shut down afterward.</li><li><strong>Relative cost:</strong> before, 1x (baseline); after, about one-eighth.</li><li><strong>Maximum input file size:</strong> before, 1 GB; after, 2 GB (16 GB is technically possible).</li></ul><p><strong>Bigger inputs, too.</strong> Cost wasn’t the only limit. Before, the largest input we could handle was capped by the biggest machine the App Service plans could offer. To keep monthly costs down, the client had settled on 32 GB machines, which meant a maximum input of <strong>1 GB</strong>. With per-job containers, memory is no longer a fixed ceiling chosen up front: each job gets what it needs. We raised the supported input size to <strong>2 GB</strong>. Technically, we can go as high as <strong>16 GB</strong>, but the client preferred a gradual rollout, raising the limit as the need arises.</p><h3>Trade-offs</h3><p>This design is not free, and it isn’t right for every workload.</p><ul><li><strong>Latency.</strong> Container instances sometimes take up to a minute or two to provision. That’s fine for jobs that run for minutes, but wrong for latency-sensitive work.</li><li><strong>Custom code to own.</strong> The scaler becomes another piece of code to maintain and monitor.</li><li><strong>Platform limits.</strong> ACI has per-region quotas and per-group CPU and memory ceilings. These limits need to be monitored constantly, and the scaler’s parameters adjusted to match.</li><li><strong>Poor fit for</strong> many tiny, fast jobs (container startup dominates), or workloads that scale fine horizontally at a uniform size.</li></ul><p>The pattern fits when <strong>all</strong> of these hold: the work is memory-bound, its size is known before it starts, each job runs to completion, and a startup delay of up to about a minute is acceptable.</p><h3>Open questions</h3><p>We’re still working on a few things, and we suspect others have opinions:</p><ul><li><strong>Settling instead of peeking.</strong> Peeking keeps the scaler simple but forces the presence checks above. Would locking and settling messages (or using sessions) be cleaner, and how would it change failure handling?</li><li><strong>Event-driven triggers.</strong> If platforms add per-execution sizing to event-driven jobs, this scaler could become unnecessary. Where does that stand today, and is anyone already doing it?</li><li><strong>Retry on OOM.</strong> Should a job that hits an OOM error be retried automatically at a larger size?</li><li><strong>Squeezing out the last drop of memory.</strong> Because of the minimum size limits on Container Apps, we could sometimes have assigned two small-file jobs to one container instance. Is that optimization worth it for the cost savings?</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b45631fd5a9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/scaling-for-memory-right-sizing-containers-on-azure-for-memory-bound-workloads-9b45631fd5a9">Scaling for Memory: Right-Sizing Containers on Azure for Memory Bound workloads</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving WCAG2.1 AA Compliance for Gaussian Solutions Website]]></title>
            <link>https://medium.com/gaussian-solutions/achieving-wcag2-1-aa-compliance-for-gaussian-solutions-website-02fbe83833cf?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/02fbe83833cf</guid>
            <category><![CDATA[web-accessibility]]></category>
            <category><![CDATA[wcag]]></category>
            <category><![CDATA[accessibility-testing]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 17:10:15 GMT</pubDate>
            <atom:updated>2026-02-12T17:17:52.269Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>How we achieved WCAG2.1 AA compliance for Gaussian Solutions Website</em></strong></p><p>When we set out to make <a href="https://gaussiansolutions.com/">our website</a> accessible, our mission was simple: ensure every user can access and navigate our content with dignity and ease, regardless of ability. We used the <strong>Web Content Accessibility Guidelines (WCAG) 2.1,</strong> a comprehensive framework that helps developers and designers create inclusive experiences for users of all abilities. In this blog post, we walk through the tools and processes we used, the issues we noticed, and how we went about fixing them. Learn about how a week’s time invested in this has helped us fix the issues on our website and also make our developers more aware of the design to pay attention to so we avoid thsese mistakes in the future.</p><h4><strong>The Requirements</strong></h4><p>We chose WCAG2.1 AA as our guiding requirements for a few reasons. First, following WCAG2.1 guidelines ensures the content is Perceivable, Operable, Understandable and Robust., and level AA addresses major barriers for users with all abilities, and also required for most legal standards. In addition, recently, DOJ finalized the rule requiring <strong>WCAG 2.1 AA</strong> compliance for State &amp; local governments, Public universities, Public digital services (web + mobile) etc. <a href="https://www.ada.gov/resources/2024-03-08-web-rule/">https://www.ada.gov/resources/2024-03-08-web-rule/</a>. As Gaussian Solutions works mostly with Public universities, we decided to be compliant with WCAG2.1 AA. One can read more about the requirements here: <a href="https://www.w3.org/TR/WCAG21/">https://www.w3.org/TR/WCAG21/</a> and a great article written by <a href="https://medium.com/u/f0a6937ef131">Faiz</a> here: <a href="https://medium.com/@faizahamedm21/how-to-achieve-wcag-2-1-compliance-for-your-web-application-a-step-by-step-guide-7edd2f1ef981">https://medium.com/@faizahamedm21/how-to-achieve-wcag-2-1-compliance-for-your-web-application-a-step-by-step-guide-7edd2f1ef981</a></p><figure><img alt="Image showing the four operating principles of WCAG2.1: Perceivable, Operable, Understandable, Robust" src="https://cdn-images-1.medium.com/max/1024/1*OYve5jL9kXQdLk6-CLyN1w.png" /><figcaption>The four principles of WCAG2.1 AA requirements: Perceivable, Operable, Understandable, Robust (POUR). Source: Created using Claude by the Author</figcaption></figure><h4><strong>The Process and the Tools</strong></h4><p>Our process consisted both of automated testing and manual testing. We used AXE (<a href="https://axe.deque.com/">https://axe.deque.com/</a>)and Lighthouse Chrome Extension as our tools to assist us in the automated testing. We used automated testing to run tests for:</p><ol><li>AXE Full page scans for all the pages on our website</li><li>AXE keyboard guided tests for all the pages</li><li>AXE user flow analysis</li><li>Lighthouse test analysis</li></ol><p>In addition, we augmented this with manual testing for:</p><ol><li>Keyboard Navigation</li><li>Screen Reader Testing</li><li>Focus ordering and</li><li>Responsiveness</li></ol><figure><img alt="Screenshot showing the AXE dev tool interface" src="https://cdn-images-1.medium.com/max/1024/1*G6j0UAC0_dLnaMgBvvmUBw.jpeg" /><figcaption>Screenshot of AXE Dev Tool interface. Source: Author</figcaption></figure><p>The initial issues surfaced using the above testing are collated in this google spreadsheet: <a href="https://docs.google.com/spreadsheets/d/13z9-1ICR9yEAWjSVHKsSO6SB0BHyEGl0LRfb7zd6yOw/edit?usp=sharing">https://docs.google.com/spreadsheets/d/13z9-1ICR9yEAWjSVHKsSO6SB0BHyEGl0LRfb7zd6yOw/edit?usp=sharing</a></p><p>The file has two tabs “automation testing report”, and “manual testing report”.</p><h4><strong>Automation Testing Report</strong></h4><p>AXE tool provides a thorough and potentially repeated list of the same issue. We summarized the issue, the page it is found on, the type of scan that was run to identify the issue, the link to the AXE report that revealed the issue and the total number of issues that resulted from the same root cause. The goal is to fix the issues identified and to rerun the scans and the resultant errors should be ZERO. As one can see from the report, the total issues after fix column is zero for most rows. For the ones that are not zero, we identified if they are real issues or a problem with the tool. In our case, we deemed the issues to be invalid issues for us and can be ignored.</p><h4><strong>Manual Testing Report</strong></h4><p>Even though AXE is a great tool, in practice it is said to catch about 50% of the issues only. For example, AXE can tell if there is an alt text, but doesn’t really tell if that alt text is a meaningful text for the image being displayed. For such cases and for catching keyboard and screen reader accessibility, we need manual testing.</p><p>Identified issues are enumerated in “Manual Testing Report” sheet. Each is given its own id, the page it was identified in, what the issue and its category is, how to reproduce the issue, what the expected result is, and what is the actual result when tested. Once all the issues are enumerated, their severity is decided. Appropriate measures were taken to fix all the issues identified using manual testing.</p><h4><strong>So, what are the main issues we found?</strong></h4><ol><li>Contrast issues : needed for users with poor vision</li><li>Missing aria-labels for links and alt-texts: needed for screen readability</li><li>Skip links: for better keyboard navigation</li><li>Focus order visibility: for a user using keyboard navigation to know where he/she is</li><li>Screenreader specific missing elements for meaningful CTAs</li></ol><p>As expected, most issues were with non-visual, and keyboard navigation.</p><h4><strong>And how did we fix them?</strong></h4><p>The website is built with Wordpress templates. We had to modify the source code to add aria labels, fix the focus order visibility, add screenreader specific elements (and in some cases, inform the screenreader to ignore the text), skip links etc. As one can imagine, where possible it is best to fix in the template so the update happens at once on the entire website.</p><p>For missing alt-text, obviously we had to manually add that text to images in Wordpress, and change the screen reader text to have meaningful messages. As an example, for a visual user, showing the blog title, a snippet of the blog, and showing a “read more” is enough. However, For a non-visual users, context is added to each elements like, screen reader will say, “Blog title: &lt;blog title&gt;, Author: &lt;user name&gt;, Published on: &lt;date&gt;”</p><h4>What did we learn overall?</h4><p>It took about a week for our UX person to go through the website, identify the issues, work with the developer and get the accessibility issues fixed and bringing it up to WCAG 2.1 compliance. In the process, the entire team, mainly the developers, also learnt what elements to pay attention to while developing to make the product more accessibility friendly. We also came up with a better internal process to check for accessibility issues.</p><h4>We can help you</h4><p>If you are a public university or an agency in the US, conformance with WCAG2.1 AA will be mandatory by 2027. Gaussian Solutions is offerings its services to help the universities to become compliant with the requirements, especially with the websites and the mobile applications. Reach out to us at <a href="https://www.gaussiansolutions.com/#contact-us">https://www.gaussiansolutions.com/#contact-us</a> so we can discuss the project details</p><p><strong><em>And next up: how accessible is our mobile app, and what we did to fix the issues in it?</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02fbe83833cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/achieving-wcag2-1-aa-compliance-for-gaussian-solutions-website-02fbe83833cf">Achieving WCAG2.1 AA Compliance for Gaussian Solutions Website</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Indian Banks’ Digital Experience Feels Stuck in 2005]]></title>
            <link>https://sureshdevalapalli.medium.com/why-indian-banks-digital-experience-feels-stuck-in-2005-ae2dbbd5f341?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae2dbbd5f341</guid>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[email-marketing]]></category>
            <category><![CDATA[personalization]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[digital-first-mindset]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 04:09:24 GMT</pubDate>
            <atom:updated>2025-09-07T04:09:24.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FjFshscCDqdlIKp2" /><figcaption>Photo by <a href="https://unsplash.com/@seogalaxy?utm_source=medium&amp;utm_medium=referral">SEO Galaxy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Here’s a hard truth: the first impression a bank makes today isn’t at the branch counter. It’s in your inbox and on their website and apps. And they suck!</p><p>And if you’ve ever opened an email from an Indian bank — Kotak, HDFC, IDBI, take your pick — you know exactly what I’m talking about. Walls of text. Generic “Dear Sir/Ma’am.” Excel attachments (yes, really). Websites that look like they were designed in Internet Explorer’s heyday.</p><p>For institutions that handle billions, the <strong><em>digital experience feels shockingly dated.</em></strong></p><h3>The Email That Sparked This</h3><p>I recently received a first-touch email from Kotak Mahindra Bank’s NRI division, and it offered a masterclass in how <strong>not</strong> to handle this crucial interaction. It was a case study in missed opportunity:</p><ul><li>No design: No logo, no colors, no visual hierarchy. Just text.</li><li>A buried call-to-action asking me to… fill out an Excel sheet and send it back.</li><li>No personalization</li></ul><p>If this is how a premium program introduces itself, what does that say about the brand? Lets dig a little deep into this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-FU86ZLsFFKDbzF5F0TKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TIMfn14fgRqVmCoJBUErBA.png" /><figcaption>Source: Screenshot of the email by the author.</figcaption></figure><h4>The Missed Opportunity of Design</h4><p>The Kotak email was nearly all text — no logo, no brand colors, no visual hierarchy. Kotak has a strong red-and-white identity, yet none of it appeared. Instead of reinforcing trust, the email resembled a plain-text message from a decade ago. And the use of colors : green for the first line, red for sections is just hideous!</p><p>Most global banks invest in <strong>centralized, branded templates</strong> for customer communications. These aren’t just aesthetic — they build recognition, trust, and security perception.</p><p>👉 Which raises the question: <strong>Why haven’t Indian banks like Kotak, HDFC, or IDBI established proper branded templates for different customer use cases? Why do they think it is OK to send half-assed shitty emails to their customers?</strong></p><h4>Unclear Call to Action</h4><p>The real call-to-action — <em>“</em><strong><em>Requesting you to please fill the attached excel &amp; revert back for further processing</em></strong><em>”</em> — was buried in a large corpus of text and is not easy to find. And why is the marketing about click2remit in this first email? B.S!</p><p>And oh yes, asking to fill details in an Excel file in a first-touch email. In 2025. From a bank. That’s not just old-fashioned, it’s a <strong>phishing red flag.</strong></p><p>👉 Which raises another uncomfortable question: <strong>Why should customers accept such low-quality / low-security communication from institutions that hold their money?</strong></p><h4>Tone, and Personalization</h4><p>“Dear Sir/Ma’am” instantly signaled a lack of personalization. For a program pitched as “elite,” this one-size-fits-all salutation is tone-deaf. In addition, what good does it serve to replace Madam with Ma’am? Doesn’t even reduce the number of characters and undermines the Ma’ams. Accepting this kind of openings normalizes mediocrity and undermines digital trust.</p><p>👉 Why aren’t <strong>relationship managers trained</strong> to send customer-friendly, personalized emails that speak to the customer as if they are face to face with them?</p><h3>It’s Not Just Emails — The Websites Are Bad Too</h3><p>The problem doesn’t stop at emails. The <strong>user experience on many Indian bank websites is equally painful.</strong> Pages are cluttered, navigation is confusing, and essential tasks require multiple clicks and patience.</p><p>👉 Banks pour millions into branches and mobile apps, but their websites — often the <strong>first research point for new customers</strong> — look outdated and unintuitive. That’s a serious disconnect.</p><h3>What Worked (and Wasn’t Enough)</h3><p>To Kotak’s credit, the email did list benefits, included a real contact, and had a compliance disclaimer. But these positives were drowned out by poor formatting and insecure practices. The same applies to websites: even if the information is all there, bad UX makes it nearly unusable.</p><h3>What Banks Should Do Differently</h3><ol><li><strong>Build professional, branded templates</strong> for email.</li><li><strong>Replace attachments</strong> with secure landing pages.</li><li><strong>Train staff</strong> on personalization, tone, and security.</li><li><strong>Simplify websites</strong> with clean design and task-first navigation.</li><li><strong>Rewrite content for clarity</strong>: one headline benefit, three supporting bullets, one CTA.</li></ol><h3>Final Thought</h3><p><strong>Great customer experience isn’t limited to branch offices; it begins with the very first email you send — and the very first time someone lands on your website.</strong></p><p>For Indian banks to be seen as modern, digital-first, and elite, they need to bring their communication standards — emails and websites included — up to the same level of polish and trust they claim in their premium products.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae2dbbd5f341" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatic feature extraction from scanned maps and raster images]]></title>
            <link>https://medium.com/gaussian-solutions/automatic-feature-extraction-from-scanned-maps-and-raster-images-3df7777c7f15?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3df7777c7f15</guid>
            <category><![CDATA[scanned-maps]]></category>
            <category><![CDATA[raster-to-vector]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[feature-extraction]]></category>
            <category><![CDATA[geological-mapping]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 18:45:05 GMT</pubDate>
            <atom:updated>2025-04-30T14:26:57.847Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*HDsZH5FRcD7eVhL6KsSZTw.png" /><figcaption>Source: USGS</figcaption></figure><h4><strong>Introduction</strong></h4><p>Facing a demanding technical challenge from DARPA (Defense Advanced Research Projects Agency), the Gaussian Solutions Team delivered an innovative, AI-driven solution to extract complex map features through semantic segmentation. In this blog, we share our approach, key insights, and how our pioneering work can drive value for geospatial organizations.</p><p><strong>Challenge Overview: DARPA’s Map Feature Extraction Challenge</strong> The <a href="https://criticalminerals.darpa.mil/Background">DARPA Map Feature Extraction Challenge</a> sought innovative methods to automatically extract features from scanned maps or raster images based on the symbols present in the legend. Traditionally, the United States Geological Survey (USGS) manually performs this task — a time-consuming and labor-intensive process.</p><p>Current automated solutions are often simplistic and fail on complex maps where features overlap or vary in symbolization. The challenge called for a generalized, machine learning-based approach capable of handling:</p><ul><li>Points represented by diverse symbols.</li><li>Lines with varying styles like dashing, boldness, or attached symbols.</li><li>Polygons differentiated by complex color patterns.</li></ul><h4><strong>Dataset</strong></h4><p>We were provided with annotated training data, including basemaps, corresponding binary raster masks, and JSON files detailing legend coordinates. Models were expected to generalize well across unseen maps and submit vectorized features efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*DsNVX13c92ToIVVKJtgGeg.png" /><figcaption>Example of the input scanned file, the legends, and the output json file. <em>Source: Authors</em></figcaption></figure><p><strong>Challenges in using the existing off the shelf models</strong></p><p>In a typical segmentation problem, the labels are the same across the dataset. However, in this challenge, the labels to predict depends on the map, the legends used to represent the same feature differ across the scanned raster maps. The maps used different colors, legends, styles, info boxes across different maps. In addition, there is no standard size of the input files. See the image below for examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqUWBPtw7_dEnd3p-G3rRw.png" /><figcaption>Example images from the dataset provided. <em>Source: Authors</em></figcaption></figure><p>This challenge right away removes direct application of the existing segmentation models since the goal is to identify the masks for the legends within the a given file. Off the shelf segmentation models expect classes are known ahead of time, and their shapes, characteristics are more uniform across the dataset.</p><h4>Our Solution</h4><p>One of the core challenges in this task was that the specific features to be extracted varied from one map to another. Therefore, we needed a way to inform the model — through its inputs — about what particular feature it should look for in a given file. We hypothesized that if we could provide the appearance of the target feature (the “label patch”) alongside the basemap patch, the model could learn to associate similar patterns or colors and generalize across diverse maps.</p><p>To achieve this, we concatenated the 3-channel basemap patch with the 3-channel legend patch, resulting in a 6-channel input tensor. This innovative design allowed us to reuse powerful off-the-shelf convolutional architectures while enabling the model to distinguish between different legend entries — even within the same map. To address variations in map sizes, all images were divided into smaller, manageable 256x256 patches. Additionally, we trained a separate Region of Interest (RoI) model to detect the relevant map area, as the the legend description area is also in the given file that should not be in the region to infer, which was then used to filter out predictions occurring outside the map boundaries.</p><h4><strong>Technical Approach</strong></h4><p>The following table shows the tools and libraries we used in our solution.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7455553d9153d645603b30bf044330fb/href">https://medium.com/media/7455553d9153d645603b30bf044330fb/href</a></iframe><p><strong>Data Preparation</strong></p><ul><li><strong>Patch Size:</strong> We chose 256x256 patches for a good balance between processing speed and accuracy.</li><li><strong>Mask Dilation:</strong> Ground truth masks were dilated using a 5x5 kernel for lines to enhance training stability.</li><li><strong>Legend Tiles:</strong> Created using median RGB values and various geometric transformations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*QZwZNtyjRwTHjCf2NlHsvQ.png" /><figcaption>Examples of patches from the input files. <em>Source: Authors</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cx3hB6Jea978_bUqqi956w.png" /><figcaption>Examples of legend patches generated from the legends. <em>Source: Authors</em></figcaption></figure><p><strong>Model Architecture</strong></p><ul><li><strong>Feature Extraction:<br></strong>- DeepLabv3 selected for best-in-class semantic segmentation.<br>- Separate networks for polygons and lines were trained.</li><li><strong>RoI Network:<br>- </strong>A separate DeepLabv3 was retrained to detect only the map regions to filter out legend areas and reduce false positives.</li><li><strong>Augmentations<br>- </strong>Robust data augmentation strategies applied including random rotations, horizontal and vertical flips</li><li><strong>Post-Processing<br>- </strong>Erosion techniques for refining line and point features.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/0*-J4zgqLampLIl_OS" /><figcaption>Overall architecture of our solution. Source: authors</figcaption></figure><p><strong>Lessons Learned</strong> We experimented with several alternatives (e.g., Unet architecture, single-channel legends, unified networks) but found them inferior. Separate specialized models and customized input structures proved to be the most effective.</p><p><strong>Challenging Cases</strong></p><ul><li><strong>Polygons:</strong> Legends with nearly identical RGB values caused minor false positives.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TPW__R7H7ntviagr--mTuQ.png" /><figcaption>False positive due to legend colors almost indistinguishable. Source: Authors</figcaption></figure><ul><li><strong>Lines:</strong> Differentiating similar feature types was challenging without highly balanced training data.</li><li><strong>Points</strong>: Points proved to be tougher than we anticipated. We also found that not all points on the map were in the reference files. This led to a mismatch between our predictions and the reference mask file in some cases, even though our predictions were showing at the right places.</li></ul><p><strong>Source Code Repository</strong> Explore our open-source contribution here:<a href="https://github.com/sureshgaussian/ai4cma/tree/train-for-non-map-region"> GitHub — GaussianSolutionsTeam AI4CMA</a></p><h4><strong>Conclusion</strong></h4><p><strong>Unlock the Power of AI for Your Geospatial Needs</strong> At Gaussian Solutions, we don’t just solve challenges — we reimagine the possibilities with AI and deep learning. Our solution for DARPA’s challenge showcases how tailored AI models can extract detailed features from complex, large-scale maps with high precision.</p><p><strong>Ready to see what our AI-driven mapping solutions can do for your organization?</strong></p><ul><li><strong>Contact Us</strong> today for a free consultation.</li><li><strong>Request a demo</strong> to explore customized solutions for your geospatial data challenges.</li><li><strong>Partner with Gaussian Solutions</strong> to modernize your map data extraction workflows.</li></ul><p>Reach out at <strong>info@gaussiansolutions.com</strong> or visit our website at<a href="http://www.gaussiansolutions.com/"> <strong>www.gaussiansolutions.com</strong></a>.</p><p>Let’s build the future of geospatial intelligence — together.</p><h4><strong>References</strong></h4><ol><li>DeepLabv3 Paper:<a href="https://arxiv.org/abs/1706.05587v3"> Rethinking Atrous Convolution for Semantic Image Segmentation</a></li><li>UNet Paper:<a href="https://arxiv.org/abs/1505.04597v1"> U-Net: Convolutional Networks for Biomedical Image Segmentation</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3df7777c7f15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/automatic-feature-extraction-from-scanned-maps-and-raster-images-3df7777c7f15">Automatic feature extraction from scanned maps and raster images</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Graph Representation Is Essential for Mapping Pedestrian Infrastructure]]></title>
            <link>https://medium.com/gaussian-solutions/why-graph-representation-is-essential-for-mapping-pedestrian-infrastructure-8471d486db94?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8471d486db94</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[centerline]]></category>
            <category><![CDATA[pédé]]></category>
            <category><![CDATA[curbs-sidewalks]]></category>
            <category><![CDATA[city-planning]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 16:06:48 GMT</pubDate>
            <atom:updated>2025-03-24T16:10:41.124Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Three ways of representing sidewalks" src="https://cdn-images-1.medium.com/max/902/1*ESXQHq4vaKudmqT-8q5Qsw.png" /><figcaption>How We Represent Sidewalks Shapes How We Plan Cities</figcaption></figure><p>In today’s cities, walkability isn’t just a buzzword — it’s an essential aspect of accessibility, safety, and sustainability. For city planners, transit agencies, and accessibility advocates, having a comprehensive inventory of pedestrian infrastructure is critical. Sidewalks, crosswalks, curb ramps, and traffic islands are as vital to urban mobility as roads and highways. But how this infrastructure is represented in data has a significant impact on how effectively it can be analyzed and improved.</p><p>At <strong>Gaussian Solutions</strong>, we believe the graph-based representation of pedestrian infrastructure is the most powerful method available for cities looking to unlock the full potential of their data. In this blog, we compare the three main ways pedestrian infrastructure is currently represented — <strong>polygon-based</strong>, <strong>annotation-based</strong>, and <strong>graph-based</strong> — and explain why the graph model stands out for transit, access, and equity analysis.</p><h3>1. Polygon-Based Representation: Good for Area, Not Connectivity</h3><p>In polygon-based mapping, sidewalks and pedestrian zones are drawn as surface areas — polygons outlining the physical space they occupy. This is commonly used in GIS systems and offers a visually rich depiction of infrastructure. It’s especially useful in architectural or land-use contexts where the physical extent of pedestrian space is important. As an example, City of Los Angeles, CA has published <a href="https://geohub.lacity.org/datasets/sidewalks/explore?location=33.795360%2C-118.270648%2C19.17">their sidewalks</a> data in this format.</p><p><strong>Strengths</strong></p><ul><li>Good for visualizing the footprint of the infrastructure</li><li>Useful in zoning and urban design applications</li><li>Helps estimate total sidewalk area or impervious surface coverage</li></ul><p><strong>Limitations</strong></p><ul><li>Lacks topological structure — doesn’t convey how the infrastructure is connected</li><li>Difficult to analyze route continuity or path accessibility</li><li>Poorly suited for travel time or network analysis</li></ul><h3>2. Annotated Road Network: Familiar but Fundamentally Limited</h3><p>Another widespread approach is to attach sidewalk data as annotations on an existing road network. This might include flags like “sidewalk exists” or “crosswalk present” as attributes on each road segment. In OpenStreetMap specifically “sidewalk:left”, “sidewalk:right”, “sidewalk:both” tags are used to represent which side of the road the sidewalks exists.</p><p>While this method is easy to implement — especially for teams already working with vehicular data — it comes with <strong>serious limitations</strong> that hinder any meaningful pedestrian analysis.</p><p><strong>Strengths</strong></p><ul><li>Easy to integrate with existing road datasets</li><li>Suitable for very high-level inventory reporting</li><li>Works reasonably well for basic sidewalk presence checks</li></ul><p><strong>Limitations</strong></p><ul><li><strong>Lacks spatial precision</strong>: Saying a sidewalk exists on the “left” or “right” of a street doesn’t specify <em>where</em> it is, how far it goes, or whether it connects to anything else</li><li><strong>Cannot represent partial coverage</strong>: If a sidewalk spans only half a block, there’s no consistent way to express this granularity</li><li><strong>No concept of pedestrian routing</strong>: The annotation is not a walkable path — it’s a metadata tag on a road, with no nodes, directionality, or continuity</li><li><strong>Fails at accessibility modeling</strong>: There’s no way to represent <em>where curb ramps are</em>, or whether it’s safe or even possible to move between sidewalk and street</li><li><strong>Ignores off-road paths</strong>: Trails, footbridges, or pedestrian-only alleys simply vanish in this model</li></ul><p>Ultimately, <em>annotated road networks reduce pedestrian infrastructure to a secondary layer on a vehicular model </em>— one that was never designed to reflect how people walk, roll, or navigate urban space on foot.</p><h3>3. Graph-Based Representation: Built for Mobility and Equity</h3><p>In a graph-based model, pedestrian infrastructure is represented as a true network: sidewalks, crossings, traffic islands, and curb ramps are encoded as nodes and edges that reflect real-world navigability. This isn’t just spatial data — it’s a <em>mobility model</em>. OpenSidewalks schema from The <a href="https://tcat.cs.washington.edu/">Taskar Center for Accessible Technology</a> is one such schema and is gaining popularity.</p><p><strong>Strengths</strong></p><ul><li>Supports detailed route, access, and ADA compliance analysis</li><li>Represents real walkable paths, not just metadata</li><li>Models precise connectivity, including which curb ramps connect to which crossings</li><li>Integrates easily with transit data, land use, and demographics for holistic planning</li><li>Enables routing, travel time modeling, and what-if simulations</li><li>Handles non-road pedestrian infrastructure (trails, plazas, overpasses)</li></ul><p><strong>Limitations</strong></p><ul><li>Requires more thoughtful data modeling and upfront processing</li><li>Less visually intuitive than polygons unless paired with map rendering tools</li></ul><p>But those trade-offs are worth it: this approach <strong>unlocks entirely new questions</strong> that planners and accessibility advocates can ask — and answer — with confidence.</p><h3>Why It Matters</h3><p>Let’s consider a real-world scenario: a city wants to understand how easily someone using a wheelchair can reach a bus stop. A polygon map might show that sidewalks exist, but not whether they connect. An annotated road network might say a sidewalk is “present” on the right side, but not whether it spans the full block, has gaps, or leads to a ramp. A graph-based map, on the other hand, can <strong>model the exact, navigable path</strong>, identify missing curb ramps, flag inaccessible crossings, and even estimate travel time based on surface slope or crossing delay.</p><p>This level of precision is essential when the stakes are real-world mobility. A missed curb ramp in data could mean a person is cut off from an entire transit line. Only a graph can model this nuance.</p><h3>When to Use Each Method</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cecfd6d445a110a851a5ef084340c496/href">https://medium.com/media/cecfd6d445a110a851a5ef084340c496/href</a></iframe><h3>In Conclusion</h3><p>Cities can’t plan for accessibility, equity, or walkability without high-quality data that accurately reflects how people move. Representing pedestrian infrastructure as a structured, connected network unlocks insights that polygon maps and road annotations simply can’t offer. A graph-based model turns static features into navigable pathways, enabling cities to analyze gaps, prioritize improvements, and ensure safe, equitable mobility for everyone.</p><p>At <strong>Gaussian Solutions</strong>, we specialize in delivering this kind of network-ready pedestrian data — built for real-world analysis.</p><p><strong><em>Want to explore how graph-based data can help your city make smarter, people-first decisions?</em> </strong><a href="https://www.gaussiansolutions.com/#contact-us"><strong>Contact us</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8471d486db94" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/why-graph-representation-is-essential-for-mapping-pedestrian-infrastructure-8471d486db94">Why Graph Representation Is Essential for Mapping Pedestrian Infrastructure</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identifying and fixing Untagged Footway Crossings in OpenStreetMap Data]]></title>
            <link>https://medium.com/gaussian-solutions/identifying-and-fixing-untagged-footway-crossings-in-openstreetmap-data-2b9a5e3f1c03?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b9a5e3f1c03</guid>
            <category><![CDATA[fix-data]]></category>
            <category><![CDATA[openstreetmap]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[data-quality]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 12:27:36 GMT</pubDate>
            <atom:updated>2024-04-05T12:27:36.527Z</atom:updated>
            <content:encoded><![CDATA[<h4>Improving the quality of data on a platform that millions of users depend on!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*LCvzz45FTf0SJE4kJ5rxpQ.png" /><figcaption>Source: <a href="https://wiki.openstreetmap.org/wiki/File:OpenStreetMap_logo_with_text.svg">File:OpenStreetMap logo with text.svg — OpenStreetMap Wiki</a></figcaption></figure><p>OpenStreetMap (OSM) is a collaborative project that empowers individuals worldwide to create and freely share geographic data. Unlike traditional proprietary mapping services, OSM is built on the principles of open data and community-driven mapping, allowing anyone to contribute, edit, and access geographic information. Launched in 2004, OSM has evolved into a comprehensive mapping platform used by millions for diverse applications, from navigation and urban planning to humanitarian aid and environmental conservation.</p><p>Despite being a commendable alternative to proprietary maps such as Google Maps, OpenStreetMap (OSM) relies on user-generated data, which may lead to inaccuracies, missing information, incorrect tags, and deviations from recommended mapping practices. For example, while working on a project that required us to examine the Los Angeles pedestrian network, we observed quite a few issues. We will go over some of them, and what the recommended practices are in those scenarios.</p><h4>Example 1: The crossings not tagged as such at an intersection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*b-RsLrl5Qz2MRmN4" /><figcaption>Source: <a href="https://www.openstreetmap.org/edit#map=19/34.05922/-118.25366">https://www.openstreetmap.org/edit#map=19/34.05922/-118.25366</a></figcaption></figure><p>From the image, we can clearly see that the highlighted path (white line with pink border) covers the underlying pedestrian crossing. However, the highlighted path is tagged as highway=footwaybut footway=crossingtag is missing.</p><h4>Example 2: Paths not split according to the recommendations</h4><p>Going back to the previous image, we also observe that four different crossings in the underlying infrastructure are marked with just one single footway. The recommended practice is to split them into 4 different crossings with each one intersect a road. It should also be noted that the linestring that was drawn and tagged as footwayactually has 6 segments. The recommended way is to create 6 segments, with 4 ways having footway=crossingand the other 2 ways tagged with footway=sidewalk as they are by the side of the roads.</p><h4>Example 3: The crossing is not separated from the footway</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fW_kyKUIHmPYH5Fl08Iig.png" /><figcaption>Source: <a href="https://www.openstreetmap.org/edit#map=19/34.05079/-118.26316">https://www.openstreetmap.org/edit#map=19/34.05079/-118.26316</a></figcaption></figure><p>Here is another example where different underlying infrastructure elements are clubbed into one representation and tagged wrongly. The highlighted path (white line with pink border) is marked just as highway=footway. However, the first and the last segments are sidewalks, which should be tagged additionally with footway=sidewalk, and the second segment is a crossing which should additionally be tagged as footway=crossing. Hence this needs to be split into three segments: one crossing and two sidewalks.</p><h4>Example 4: The crossing is not separated from the sidewalk</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*xU1gwn7_9tyGOjAe" /><figcaption>Source: <a href="https://www.openstreetmap.org/edit#map=18/34.05346/-118.24820">https://www.openstreetmap.org/edit#map=18/34.05346/-118.24820</a></figcaption></figure><p>Here the highlighted path (white line with pink border) is marked as highway=footway, footway=sidewalk. This is wrong. The portion of the element that spans the crosswalk should be tagged as highway=footway, footway=crossingIn addition, it should be split into two segments, one representing the sidewalk, and the other representing the crosswalk as is evident from the image of the underlying infrastructure.</p><h4>Example 5: One sidewalk spans multiple blocks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SXa_tezvecLBrtk6" /><figcaption>Source: <a href="https://www.openstreetmap.org/edit?node=10224712629#map=20/34.04088/-118.26055">https://www.openstreetmap.org/edit?node=10224712629#map=20/34.04088/-118.26055</a></figcaption></figure><p>As we can see the highlighted element (white line with pink border) is tagged as sidewalk and spans multiple blocks. The recommended way to map this element is to:</p><ul><li>Split the line into multiple segments, where each segment represents no more than one block of length.</li><li>Whenever the line intersects with a road, tag the intersection point as highway=intersection</li><li>If the line segment is representing a crossing in the infrastructure, tag it as highway=footway and footway=crossing</li></ul><h4>How to fix such issues?</h4><ul><li>Learn to map properly by getting yourself familiar with the recommended mapping practices from the OSM community.</li><li>Inspect the data before using it and fix the tags when you see a mistake.</li></ul><p>Identifying issues manually is a laborious process. For an area as big as Los Angeles, it may take weeks to identify all the issues manually.</p><p>At Gaussian Solutions, we are all about productivity and the tools that help boost the productivity. So we wrote an algorithm to identify and fix the issues we mentioned above.</p><h4>Example Results</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/0*a-Mtd4wY0XwZCadZ" /><figcaption>Source: Author’s own work</figcaption></figure><p>The above picture shows the output of our algorithm for the zip code 90012 in the LA region. The yellow line is the boundary of the downtown (source: <a href="https://geohub.lacity.org/datasets/70748ba37ecc418891e052e800437681_5/explore">LA boundary dataset</a>). The blue lines indicate all the footways in the region obtained from the OpenStreetMap data. And the red lines indicate the problematic elements in the data. We found a total of 89 footways with problems in the 90012 area.</p><p><em>What are the issues you faced while working with the OSM data? Leave a comment, and we may have a solution for it, and if we do not, we will come up with one.</em></p><p>Stay tuned while we deploy the algorithm we wrote as a service that anyone can use. Just draw the boundary where you want the issues identified and fixed, and we will give you a dump of OSM data, with its elements fixed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b9a5e3f1c03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/identifying-and-fixing-untagged-footway-crossings-in-openstreetmap-data-2b9a5e3f1c03">Identifying and fixing Untagged Footway Crossings in OpenStreetMap Data</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Geospatial Terminology Demystified]]></title>
            <link>https://medium.com/gaussian-solutions/geospatial-terminology-demystified-a9f5725494c0?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f5725494c0</guid>
            <category><![CDATA[geospatial]]></category>
            <category><![CDATA[terminology]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 16:07:35 GMT</pubDate>
            <atom:updated>2024-02-16T16:07:35.831Z</atom:updated>
            <content:encoded><![CDATA[<p>Get familiar with the terms used in Geospatial domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NN4qWwvuGBELp_cb" /><figcaption>Photo by <a href="https://unsplash.com/@usgs?utm_source=medium&amp;utm_medium=referral">USGS</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Introduction</strong>:<br>Geographic Information Systems (GIS) have revolutionized the way we understand and interact with spatial data. Within GIS, there are several terms and techniques that are essential to grasp for effectively analyzing and visualizing geographic information. In this article, we’ll explore these terms and their applications in GIS.</p><p>1. <strong>Planimetry</strong>:<br>Planimetry involves the measurement and analysis of two-dimensional features on a surface, such as maps or aerial imagery. In GIS, planimetry is used for tasks such as land use planning, urban development, and environmental monitoring. For example, urban planners use planimetric data to analyze existing land use patterns and assess the suitability of areas for development.</p><p>2. <strong>Photogrammetry</strong>:<br>Photogrammetry is the process of deriving spatial information from photographs or imagery. In GIS, photogrammetry is used to create 3D models of terrain, buildings, and other objects from aerial or satellite imagery. This technique is valuable for tasks such as mapping, urban planning, and infrastructure design.</p><p>3. <strong>Orthoimagery</strong>:<br>Orthoimagery refers to aerial or satellite imagery that has been geometrically corrected to remove distortions caused by terrain relief, camera tilt, and perspective. In GIS, orthoimagery provides a high-resolution, accurate representation of the Earth’s surface, which is essential for tasks such as land surveying, mapping, and environmental analysis.</p><p>4. <strong>Bathymetry</strong>:<br>Bathymetry is the measurement and mapping of water depth in oceans, seas, lakes, and rivers. In GIS, bathymetric data is used for tasks such as marine navigation, coastal zone management, and habitat mapping. For example, bathymetric maps help scientists and policymakers understand underwater topography and plan marine conservation efforts.</p><p>5. <strong>Topography</strong>:<br>Topography refers to the study and mapping of the Earth’s surface, including its elevation, terrain, and features such as hills, valleys, and rivers. In GIS, topographic data is used for tasks such as land surveying, flood modeling, and site analysis. Topographic maps provide valuable information for understanding and navigating the natural landscape.</p><p>6. <strong>Topobathymetry</strong>:<br>Topobathymetry combines topographic and bathymetric data to provide a comprehensive representation of both land and underwater terrain. In GIS, topobathymetric data is used for tasks such as coastal zone management, marine resource planning, and environmental monitoring. This integrated dataset helps scientists and planners understand the interactions between land and sea.</p><p>7. <strong>Geodesy</strong>:<br>Geodesy is the science of accurately measuring and understanding the Earth’s shape, orientation, and gravitational field. In GIS, geodesy provides the foundation for coordinate systems, map projections, and spatial reference frameworks. Geodetic data is essential for tasks such as navigation, surveying, and map production.</p><p><strong>Conclusion</strong>:<br>Understanding these key terms and techniques in GIS is essential for effectively working with spatial data and solving real-world problems. Whether it’s analyzing urban development patterns, mapping underwater topography, or navigating the natural landscape, GIS provides powerful tools and insights for exploring the world around us. By leveraging these techniques, we can better understand our environment, make informed decisions, and create sustainable solutions for the future.</p><p><em>Note: Help from Generative AI was taken to create this article.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f5725494c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/geospatial-terminology-demystified-a9f5725494c0">Geospatial Terminology Demystified</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to find changes made in GitHub organization within the last few days]]></title>
            <link>https://medium.com/gaussian-solutions/how-to-find-changes-made-in-github-organization-within-the-last-few-days-9961dced4c1a?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9961dced4c1a</guid>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 15:31:13 GMT</pubDate>
            <atom:updated>2023-06-13T15:31:13.320Z</atom:updated>
            <content:encoded><![CDATA[<h4>Scripting to reduce the time it takes to consolidate and review the changes using Python and GitHub APIs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b9ka5YZPF1vfVePE" /><figcaption>Photo by <a href="https://unsplash.com/@yancymin?utm_source=medium&amp;utm_medium=referral">Yancy Min</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I lead a group of very active developer engineers who commit code, PR and merge almost on a daily basis. I do not often have the time to go through each of the changes. However, from time to time, I monitor the progress, do code reviews, comment on the changes I need the engineers to do. One of the <strong><em>challenge I often face is tracking down the commits, and PRs across multiple repositories</em></strong> (we have over 15). I usually dedicate a day in the week to go through the changes and point check them. I needed a way to consolidate all the changes in one place that I can review. GitHub UI doesn&#39;t provide any such facility, and I need to go through each repository separately to check the commits. This is a <strong><em>painful process</em></strong>. I needed a way to fetch the changes on demand and quickly.</p><p>GitHub APIs provided the solution. This article is about how I used GitHub APIs with Python to achieve what I wanted to achieve:</p><ul><li>Quick summary of all the Pull Requests in the last week. More generically within the last ‘x’ days. The information I want to see include who the author of the PR is, what state it is in, the URL I can follow to see the full details of the PR</li><li>Quick summary of all the commits made in the last ‘x’ days. Details I am interested in are author, link to the commit, and the commit message.</li></ul><h3>Figuring out how to consolidate the PRs</h3><p>GitHub APIs are documented at <a href="https://docs.github.com/en/rest?apiVersion=2022-11-28">GitHub REST API documentation — GitHub Docs</a></p><p>What we are interested in is the <a href="https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28">Pulls — GitHub Docs</a> ‘REST API to interact with pull requests’, more specifically ‘list pull requests’ API specified at<a href="https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests"> List Pulls — GitHub Docs</a></p><pre>https://api.github.com/repos/OWNER/REPO/pulls</pre><p>The above APIs takes two main inputs:</p><ol><li>OWNER: the owner of the repos we are interested in querying. For my case, OWNER is my organization.</li><li>REPO: the repository for which we can fetch the pull requests for.</li></ol><p>As you can see GitHub doesn&#39;t provide a way to fetch all the PRs under an organization, but rather gives ability to pull from one repository at a time.</p><p>Oh! oh! How do we then get PRs for all the repositories? Well, is there an API to list all the repositories within an organization? If so, we can iterate over the repositories, and fetch the PRs for each repository.</p><h3>How to fetch repositories under an organization?</h3><p>Sure enough there is an API for that. <a href="https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28">Repositories — GitHub Docs</a> <a href="https://api.github.com/orgs/ORG/repos">https://api.github.com/orgs/ORG/repos</a></p><p>ORG: the organization name we are interested in pulling the information for. The curl command to fetch repositories under the ORG is as follows:</p><pre>curl -L \<br>  -H &quot;Accept: application/vnd.github+json&quot; \<br>  -H &quot;Authorization: Bearer &lt;YOUR-TOKEN&gt;&quot;\<br>  -H &quot;X-GitHub-Api-Version: 2022-11-28&quot; \<br>  https://api.github.com/orgs/ORG/repos</pre><p>Wait a minute what is the &lt;YOUR-TOKEN&gt; in the above call?</p><h3>Authorization requirements for using the APIs</h3><p>To use the APIs effectively, GitHub API end points require an access token. For good security measures, it is always helpful to create access tokens with just enough permissions to carry out what we want to achieve. In this case, we want to read the repositories, their PRs, and commits. GitHub allows creation of ‘Personal Access Tokens’ with fine grain permissions. Procedure is:</p><ol><li>Go to your GitHub profile. Profile → Settings → Developer Settings → Personal Access Tokens → Generate new token.</li><li>Give the token a name, a description that you can use to remember why you created a token for and choose the access levels. Since I have some private repositories, I chose ‘All repositories’ as the repository access level.</li><li>Chose the permissions to give. In my case, I need to read the ‘commit statuses’ and the ‘pull requests’. So, I chose those two to create a personal access token. Keep this token in a secure place, as you don’t want to share this with anyone, and you would need it to access the end points.</li></ol><p><strong>Note</strong>: <em>It seems like for public repositories, one doesn&#39;t need a token to access the repository, PRs or commits.</em></p><p>Just a quick check on what we did so far:</p><ul><li>We got a PAT (Personal Access Token)</li><li>Figured out the APIs to fetch the repositories under an organization, and the pull requests under a repository.</li></ul><p>With this information, we are ready to go onto writing the code to get the PRs under the organization. Logic is pretty simple:</p><ol><li>Fetch the repositories under an organization.</li><li>For each of the repositories, fetch the PRs under the organization.</li><li>Filter the ones that were created, updated in the last ‘x’ days</li><li>Format the output to show: the URL, the title, the author, and in what state the PRs is in (open, or closed)</li></ol><p>I chose Python as it is an elegant language, and something I enjoy working with. Here is the Python code.</p><pre>def get_pr_changes(num_past_days):<br><br>    # Construct the API URL to get all repositories<br>    api_url = f&quot;https://api.github.com/orgs/{organization}/repos&quot;<br><br>    # Set the headers with your access token<br>    headers = {<br>        &#39;Authorization&#39;: f&#39;Bearer {access_token}&#39;,<br>        # &#39;Accept&#39;: &#39;application/vnd.github+json&#39;,<br>        &#39;X-GitHub-Api-Version&#39;: &#39;2022-11-28&#39;<br>    }<br><br>    # Send a GET request to the API to get all repositories<br>    response = requests.get(api_url, headers=headers)<br>    repositories = response.json()    <br>    <br>    # Get the current date and the date 7 days ago<br>    current_date = datetime.datetime.now().date()<br>    num_days_ago = current_date - datetime.timedelta(days=num_past_days)<br>    change_log = []<br><br>    # Iterate over the repositories and retrieve the pull requests made within the last 7 days<br>    for repo in repositories:<br>        repo_name = repo[&#39;name&#39;]<br>        # Construct the API URL to get the repository&#39;s pull requests<br>        changes_ep = &quot;pulls&quot;<br>        changes_url = f&quot;https://api.github.com/repos/{organization}/{repo_name}/{changes_ep}&quot;<br><br>        # Send a GET request to the API to get the repository&#39;s pull requests<br>        changes_response = requests.get(changes_url, headers=headers)<br>        if changes_response.ok:<br>            pull_requests = changes_response.json()<br>        else:<br>            print(f&quot;Issue getting info from {repo_name}, response status = {changes_response.status_code}&quot;)<br>            continue<br><br>        for pr in pull_requests:<br>            pr_created_at = datetime.datetime.strptime(pr[&#39;created_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date()<br>            pr_updated_at = datetime.datetime.strptime(pr[&#39;updated_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date()<br>            pr_closed_at = datetime.datetime.strptime(pr[&#39;closed_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date() if pr[&#39;closed_at&#39;] else None<br><br>            if pr_created_at &gt;= num_days_ago or pr_updated_at &gt;= num_days_ago or (pr_closed_at and pr_closed_at &gt;= num_days_ago):<br>                pr_url = pr[&#39;html_url&#39;]<br>                pr_title = pr[&#39;title&#39;]<br>                pr_author = pr[&#39;user&#39;][&#39;login&#39;]<br>                pr_state = pr[&#39;state&#39;]<br>                print(f&#39;url = {pr_url}, title={pr_title}, author={pr_author}, state={pr_state}&#39;)<br>                change_log.append( (pr_url, pr_title, pr_author, pr_state))<br><br>    return change_log</pre><p>I initialized organization and access_token as global variables, though one can chose to pass them as arguments to the function. I chose it because we are going to write another function to retrieve commits as well.</p><p>We will also talk about the Python modules we will need to run the above code in a bit.</p><h4>Issue with the above code</h4><p>When I ran the above code, I observed that it was NOT retrieving all the PRs that were created in the last ‘x’ days that I gave. Many repositories showed zero PRs even though I knew there were PRs that were raised and merged. On further debugging (read the docs carefully), it was revealed that the endpoint by default only returns PRs that are in open state. To fetch all the PRs including the ones that were closed we need to add a parameter to the request.</p><pre>changes_url = f&quot;https://api.github.com/repos/{organization}/{repo_name}/{changes_ep}?state=all&quot;</pre><p>With the above change, I was able to fetch all the PRs including the ones that were closed.</p><p>The full code then is as follows:</p><pre>def get_pr_changes(num_past_days):<br><br>    # Construct the API URL to get all repositories<br>    api_url = f&quot;https://api.github.com/orgs/{organization}/repos&quot;<br><br>    # Set the headers with your access token<br>    headers = {<br>        &#39;Authorization&#39;: f&#39;Bearer {access_token}&#39;,<br>        # &#39;Accept&#39;: &#39;application/vnd.github+json&#39;,<br>        &#39;X-GitHub-Api-Version&#39;: &#39;2022-11-28&#39;<br>    }<br><br>    # Send a GET request to the API to get all repositories<br>    response = requests.get(api_url, headers=headers)<br>    repositories = response.json()    <br>    <br>    # Get the current date and the date 7 days ago<br>    current_date = datetime.datetime.now().date()<br>    num_days_ago = current_date - datetime.timedelta(days=num_past_days)<br>    change_log = []<br><br>    # Iterate over the repositories and retrieve the pull requests made within the last 7 days<br>    for repo in repositories:<br>        repo_name = repo[&#39;name&#39;]<br>        # print(&quot;Repo being investigated: &quot;, repo_name)<br>        # Construct the API URL to get the repository&#39;s pull requests<br>        changes_ep = &quot;pulls&quot;<br>        changes_url = f&quot;https://api.github.com/repos/{organization}/{repo_name}/{changes_ep}?state=all&quot;<br><br>        # Send a GET request to the API to get the repository&#39;s pull requests<br>        changes_response = requests.get(changes_url, headers=headers)<br>        if changes_response.ok:<br>            pull_requests = changes_response.json()<br>        else:<br>            print(f&quot;Issue getting info from {repo_name}, response status = {changes_response.status_code}&quot;)<br>            continue<br><br>        for pr in pull_requests:<br>            pr_created_at = datetime.datetime.strptime(pr[&#39;created_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date()<br>            pr_updated_at = datetime.datetime.strptime(pr[&#39;updated_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date()<br>            pr_closed_at = datetime.datetime.strptime(pr[&#39;closed_at&#39;], &quot;%Y-%m-%dT%H:%M:%SZ&quot;).date() if pr[&#39;closed_at&#39;] else None<br><br>            if pr_created_at &gt;= num_days_ago or pr_updated_at &gt;= num_days_ago or (pr_closed_at and pr_closed_at &gt;= num_days_ago):<br>                pr_url = pr[&#39;html_url&#39;]<br>                pr_title = pr[&#39;title&#39;]<br>                pr_author = pr[&#39;user&#39;][&#39;login&#39;]<br>                pr_state = pr[&#39;state&#39;]<br>                print(f&#39;url = {pr_url}, title={pr_title}, author={pr_author}, state={pr_state}&#39;)<br>                change_log.append( (pr_url, pr_title, pr_author, pr_state))<br><br>    return change_log</pre><h3>Figuring out how to consolidate the commits done in the last x days</h3><p>Let’s figure out how to consolidate the commits now.</p><p>Reading the document at (now that we have experience with the missing state with the PRs) <a href="https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits">Commits — GitHub Docs</a>, reveals that by default the API will only return the commits on the default branch which is main. The API provides parameter called sha to indicate the branch we are interested in pulling the commits for.</p><p>Wait a minute, how do we then pull commits for all the branches? Well, we have to iterate over the branches in a repository. The API to get the branches in a repository is <a href="https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#list-branches">Branches — GitHub Docs</a></p><pre>curl -L \<br>  -H &quot;Accept: application/vnd.github+json&quot; \<br>  -H &quot;Authorization: Bearer &lt;YOUR-TOKEN&gt;&quot;\<br>  -H &quot;X-GitHub-Api-Version: 2022-11-28&quot; \<br>  https://api.github.com/repos/OWNER/REPO/branches</pre><p>The logic to fetch the commits:</p><ol><li>Get list of repositories under the organization</li><li>For each repository, get the full list of the branches</li><li>For each of the branches, fetch the commits</li><li>Filter the commits that were done in the last ‘x’ days</li></ol><p>Interestingly the API for commits gives ability to filter out the commits within a date range using since and until parameters. So that’s what we will use for step 4 instead of writing our own date filter logic. (I am not sure why GitHub didn&#39;t implement this for PRs)</p><p>The code is</p><pre>def get_commit_changes(num_past_days):<br><br>    # Construct the API URL to get all repositories<br>    api_url = f&quot;https://api.github.com/orgs/{organization}/repos&quot;<br><br>    # Set the headers with your access token<br>    headers = {<br>        &#39;Authorization&#39;: f&#39;Bearer {access_token}&#39;,<br>        # &#39;Accept&#39;: &#39;application/vnd.github+json&#39;,<br>        &#39;X-GitHub-Api-Version&#39;: &#39;2022-11-28&#39;<br>    }<br><br>    # Send a GET request to the API to get all repositories<br>    response = requests.get(api_url, headers=headers)<br>    repositories = response.json()    <br><br>    current_date = datetime.datetime.now()<br>    num_days_ago = current_date - datetime.timedelta(days=num_past_days)<br>    num_days_ago_iso = num_days_ago.strftime(&quot;%Y-%m-%dT%H:%M:%SZ&quot;)<br>    change_log = []<br><br>    # Iterate over the repositories and retrieve the pull requests made within the last 7 days<br>    for repo in repositories:<br>        repo_name = repo[&#39;name&#39;]<br>        # print(&quot;Repo being investigated: &quot;, repo_name)<br>        # Construct the API URL to get the repository&#39;s pull requests<br>        changes_ep = &quot;commits&quot;<br><br>        branches_url = f&quot;https://api.github.com/repos/{organization}/{repo_name}/branches&quot;<br>        branches = requests.get(branches_url, headers=headers).json()<br>        for branch in branches:<br>        # Send a GET request to the API to get the repository&#39;s pull requests<br>            branch_name = branch[&#39;name&#39;]<br>            changes_url = f&quot;https://api.github.com/repos/{organization}/{repo_name}/{changes_ep}?since={num_days_ago_iso}&amp;sha={branch_name}&quot;<br>            changes_response = requests.get(changes_url, headers=headers)<br>            if changes_response.ok:<br>                commits = changes_response.json()<br>            else:<br>                print(f&quot;Issue getting info from {repo_name}, response status = {changes_response.status_code}&quot;)<br>                continue<br><br>            for commit in commits:<br>                # print(commit)<br>                commit_url = commit[&#39;commit&#39;][&#39;url&#39;]<br>                commit_title = commit[&#39;commit&#39;][&#39;message&#39;]<br>                commit_author = commit[&#39;commit&#39;][&#39;author&#39;][&#39;name&#39;]<br>                print(f&#39;url = {commit_url}, title={commit_title}, author={commit_author}&#39;)<br>                change_log.append( (commit_url, commit_title, commit_author))<br><br>    return change_log</pre><p>I added code to take as argument which changes I am interested in, and how many past days I want to see, and optionally write the output to a csv file for further analysis. The code for that, and the imports are as follows:</p><pre>import csv<br>import argparse<br>import requests<br>import datetime<br><br>def get_n_save_changes(args):<br><br>    if args.changes == &quot;prs&quot;:<br>        changes = get_pr_changes(args.num_past_days)<br>    elif args.changes == &quot;commits&quot;:<br>        changes = get_commit_changes(args.num_past_days)<br>    else:<br>        print( &quot; Unsupported type of changes specified&quot;)<br>        exit(0)<br><br>    if args.save_in:<br>        with open(args.save_in, &quot;w&quot;) as f:<br>            writer = csv.writer(f)<br>            writer.writerows(changes)<br><br><br><br>if __name__ == &quot;__main__&quot;:<br>    # Create the argument parser<br>    parser = argparse.ArgumentParser(description=&#39;Arg parsers for getting recent changes from github.&#39;)<br><br>    # Argument for looking at the last &#39;x&#39; days<br>    parser.add_argument(&quot;-d&quot;,&quot;--num_past_days&quot;, type=int, help=&#39;Number of days to look back into&#39;)<br>    # Type of changes we want to get<br>    parser.add_argument(&quot;-c&quot;,&quot;--changes&quot;, choices=github_changes.keys(), help=f&#39;Type of changes to fetch:{github_changes.keys()}&#39;)<br><br>    #save info in a csv file<br>    parser.add_argument(&quot;-s&quot;, &quot;--save_in&quot;, type=str, help=&quot;csv file to store the output in&quot;)<br><br>    # Parse the arguments<br>    args = parser.parse_args()<br>    if args.num_past_days is None or args.changes is None:<br>        print(&quot;Invalid arguments provided... See the usage below\n\n&quot;)<br>        parser.print_help()<br><br>    get_n_save_changes(args)</pre><p>You can get the full code here:</p><p><a href="https://gist.github.com/sureshgaussian/c78159e2b8a7027423827340cb828cbe">https://gist.github.com/sureshgaussian/c78159e2b8a7027423827340cb828cbe</a></p><p>🙌<em> Enjoyed this article? If you found it helpful, insightful, or inspiring, consider supporting me on </em><a href="https://www.buymeacoffee.com/sureshd"><em>BuyMeACoffee</em></a><em>! Your support goes a long way in fueling my passion for creating valuable content and empowering more readers like you.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9961dced4c1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gaussian-solutions/how-to-find-changes-made-in-github-organization-within-the-last-few-days-9961dced4c1a">How to find changes made in GitHub organization within the last few days</a> was originally published in <a href="https://medium.com/gaussian-solutions">Gaussian Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to prune git local branches that are not on the remote]]></title>
            <link>https://sureshdevalapalli.medium.com/how-to-prune-git-local-branches-that-are-not-on-the-remote-9c6bcd525076?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c6bcd525076</guid>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Sun, 05 Jun 2022 21:23:53 GMT</pubDate>
            <atom:updated>2022-06-05T21:23:53.927Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*Q2XZiIMxzP7jgNIkjF0VvQ.png" /><figcaption>Typical git branch diagram (Source: author)</figcaption></figure><p>The number of branches in git grows as the development progresses. Branching and merging are natural way of development. (Note: if you’re not branching and merging, you’re not doing software development right). Typically, the merged branches get deleted on the remote git server once the pull request is taken care of by the integrator/QA person. However, that doesn’t automatically delete one’s corresponding local git branch. If one is not careful, one may end up with a lot of local branches. It is a good idea to clean the local branches often.</p><p>As usual, git provides a multitude of options for one to shoot oneself with. I found solutions on stackoverflow (for example: <a href="https://stackoverflow.com/questions/16590160/remove-branches-not-on-remote">git — remove branches not on remote — Stack Overflow</a>) that show one-line answers. Even though I like the terse command to get the job done, I often find it difficult to remember them.</p><p>In addition, I would like to run that command to clean up local branches from whichever branch I am currently on. The procedure is to do the following:</p><ul><li>Change the branch to ‘main’ or ‘master’; because I assume every company has one of these two branches</li><li>Fetch the latest from git remote: this makes sure we have the latest info. Remember to fetch with prune option</li><li>Go through the list of the branches, and check which ones are ‘gone’, and remove them</li></ul><p>After trying do all these in one line in bash, and trying to set an alias for it, I resorted to bash functions for two reasons:</p><ul><li>Getting it in an alias was getting harder</li><li>Function just made easier and to add more informative messages</li></ul><p>Here is my bash function to prune the local branches</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1247b82d24f6277bd77a17354491761a/href">https://medium.com/media/1247b82d24f6277bd77a17354491761a/href</a></iframe><p>I added the above piece of code into my .bashrcfile. Voila! Now anytime, I want to clean my local branches, all I’ve to do is type git-prune-branches</p><p>And some of you are about to complain git-prune-branches is too long to type. Well, let’s just go ahead and add an alias then:</p><p>alias gpb=&#39;git-prune-branches&#39;</p><p>There you go! Now you can type gpb and it does all the cleaning!</p><p>Keep the local repository clean!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c6bcd525076" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to drop columns in a Panda DataFrame that has NaNs that exceed a threshold?]]></title>
            <link>https://sureshdevalapalli.medium.com/how-to-drop-columns-in-a-panda-dataframe-that-has-nans-that-exceed-a-threshold-698c717cb72b?source=rss-cfc12733636b------2</link>
            <guid isPermaLink="false">https://medium.com/p/698c717cb72b</guid>
            <dc:creator><![CDATA[Suresh Devalapalli]]></dc:creator>
            <pubDate>Mon, 14 Feb 2022 22:34:23 GMT</pubDate>
            <atom:updated>2022-02-14T22:34:23.262Z</atom:updated>
            <content:encoded><![CDATA[<p>Many a times we are given data with missing values. Handling of missing data is a common problem in data science. It is more of an art than science. Usual techniques involve dropping the rows with missing values or dropping an entire column. However, there are cases in which we want to drop the column only if it has missing data exceeding certain threshold. Rationale being unless most of the data is missing, we can still extract some value out of the given data.</p><p>Useful Pandas functions for dropping rows, columns are:</p><pre><strong>DataFrame.dropna(<em>axis=0</em>, <em>how=&#39;any&#39;</em>, <em>thresh=None</em>, <em>subset=None</em>, <em>inplace=False</em>)</strong></pre><p>Providing threshold, and subset appropriately we can get some of the desired outputs.</p><p><em>Drop columns that are completely missing data: </em>df.dropna(axis=1, how=&#39;all&#39;)</p><p><em>Drop rows that are completely missing data: </em>df.dropna(axis=0, how=&#39;all&#39;)</p><p><em>Drop columns that are missing 80% of the data: </em>df.dropna(axis=1, thresh=0.2*len(df))</p><p><em>Drop columns that are missing x% of the data: </em>df.dropna(axis=1, thresh=(1-x/100)*len(df) )</p><p><em>Drop rows that are missing x% of the data: </em>df.dropna(axis=0, thresh=(1-x/100)*len(df) )</p><p>Find out the columns that need to be dropped for a given threshold:</p><pre>def get_nan_cols(df, nan_percent=0.8):<br>    threshold = len(df.index) * nan_percent<br>    return [c for c in df.columns if df[c].isnull().sum() &gt;= threshold]</pre><pre>cols_to_del = get_nan_cols(df, threshold)</pre><p><strong>References:</strong></p><p>[1] <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.dropna.html">pandas.DataFrame.dropna — pandas 1.4.1 documentation (pydata.org)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=698c717cb72b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>