<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ashlynn Antrobus</title><link>https://ashlynnantrobus.dev/</link><description>Recent content on Ashlynn Antrobus</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 26 Aug 2024 23:01:24 +0000</lastBuildDate><atom:link href="https://ashlynnantrobus.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Unit Testing Difficulty is an Indicator of (Low) Code Quality</title><link>https://ashlynnantrobus.dev/posts/unit-testing-difficulty-is-an-indicator-of-low-code-quality/</link><pubDate>Mon, 26 Aug 2024 23:01:24 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/unit-testing-difficulty-is-an-indicator-of-low-code-quality/</guid><description>&lt;p&gt;When I first read about unit testing, I’ll admit, it sounded like one of those things that only seasoned developers would bother with. It seemed like a maze of confusing terms and intimidating processes that only experts could navigate.  I didn’t write my first test for over a year after I started my coding journey. Until then, my version of testing was typing &lt;code&gt;python my\_project.py&lt;/code&gt; in the terminal. Or, I will sheepishly admit, just hitting the “Run” button in VS Code (and Replit before that). Then waiting for it to crash and debugging from there. It was my version of compiled languages developers who claim that if the code compiles, it must be free of errors.&lt;/p&gt;</description></item><item><title>Evolution of a codebase</title><link>https://ashlynnantrobus.dev/posts/evolution-of-a-codebase/</link><pubDate>Mon, 15 Jul 2024 04:27:52 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/evolution-of-a-codebase/</guid><description>&lt;p&gt;When I wrote the first version of Lorebinders, I hadn&amp;rsquo;t yet started exploring object oriented programming. v1 has comprised by a series of functions strung in a row, one, calling the next.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately (or maybe fortunately!), that code was gone before I discovered version control. It is gone for ever.&lt;/p&gt;&#10;&lt;p&gt;For the first refactoring, I organized it a little better, but still depended sole on functions like these:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;def search_names(chapters: list, folder_name: str, num_chapters: int, character_lists: list, character_lists_index: int) -&amp;gt; list:&#10;&#10; character_lists_path = os.path.join(folder_name, &amp;#34;character_lists.json&amp;#34;)&#10; role_script = ner_role_script(folder_name)&#10; model = &amp;#34;gpt_three&amp;#34;&#10; max_tokens = 1000&#10; temperature = 0.2&#10;&#10; with tqdm(total = num_chapters, unit = &amp;#34;Chapter&amp;#34;, ncols = 40, bar_format = &amp;#34;|{l_bar}{bar}|&amp;#34;, position = 0, leave = True) as progress_bar:&#10; for chapter_index, chapter in enumerate(chapters):&#10; progress_bar.set_description(f&amp;#34;\033[92mProcessing chapter {chapter_index + 1} of {num_chapters}&amp;#34;, refresh = True)&#10; if chapter_index &amp;lt; character_lists_index:&#10; progress_bar.update(1)&#10; continue&#10; chapter_number = chapter_index + 1&#10; prompt = f&amp;#34;Text: {chapter}&amp;#34;&#10; character_list = cf.call_gpt_api(model, prompt, role_script, temperature, max_tokens)&#10; chapter_tuple = (chapter_number, character_list)&#10; character_lists.append(chapter_tuple)&#10; cf.append_json_file(chapter_tuple, character_lists_path)&#10; progress_bar.update(1)&#10; cf.clear_screen()&#10; return character_lists&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When I started v2, leaning into object oriented programing principles, I quickly learned that classes don&amp;rsquo;t make dependency and coupling any simpler. I needed to initialize the API class, get the text from the chapter, and save the response to the chapter. It looked easy to organize when each class was was separate.&lt;/p&gt;</description></item><item><title>The case for code review groups</title><link>https://ashlynnantrobus.dev/posts/the-case-for-code-review-groups/</link><pubDate>Tue, 09 Jul 2024 22:45:13 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/the-case-for-code-review-groups/</guid><description>&lt;p&gt;&lt;em&gt;As one of my other hats, I am an indie author with 10 stories out across 2 pen names.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;One of the ways that authors, especially newer authors grow in their craft is by participating in critique groups. Sometimes these are small, informal groups of a few authors who share their work in turn for the others to offer feedback. Sometimes, these are sites where authors earn credits by critiquing stories (or just plain buying them) and spending those credits to share their story for critique.&lt;/p&gt;</description></item><item><title>Back to the __future__ and import annotations</title><link>https://ashlynnantrobus.dev/posts/back-to-the-__future__-and-import-annotations/</link><pubDate>Sun, 30 Jun 2024 22:56:25 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/back-to-the-__future__-and-import-annotations/</guid><description>&lt;p&gt;After last week, I thought I was done with module import errors. Turns out, I had only just started with them.&lt;/p&gt;&#10;&lt;p&gt;After months of hard work, I have finally written all of the code for my LoreBinders project. Now to see if it works!&lt;/p&gt;&#10;&lt;p&gt;So I wrote tests for everything, typed &lt;code&gt;pytest&lt;/code&gt; into the terminal and hit enter.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;ImportError while importing test module &amp;#39;vscode\ProsePal\lorebinders\tests\test_ai_factory.py&amp;#39;.&#10;Hint: make sure your test modules/packages have valid Python names.&#10;Traceback:&#10; from lorebinders._managers import EmailManager, RateLimitManager&#10;src\lorebinders\_managers.py:4: in &#10;from _types import AIModelRegistry, APIProvider, Model, ModelFamily&#10;src\lorebinders_types.py:12: in&#10;from _managers import AIProviderManager, EmailManager, ErrorManager&#10;src\lorebinders_managers.py:4: in&#10;from _types import AIModelRegistry, APIProvider, Model, ModelFamily&#10;E ImportError: cannot import name &amp;#39;AIModelRegistry&amp;#39; from partially initialized module &amp;#39;_types&amp;#39; (most likely due to a circular import)&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;15 times. Different modules, same problem.&lt;/p&gt;</description></item><item><title>How to fix 'module' could not be resolved from source Python linter errors</title><link>https://ashlynnantrobus.dev/posts/how-to-fix-module-could-not-be-resolved-from-source-python-linter-errors/</link><pubDate>Mon, 17 Jun 2024 04:00:51 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/how-to-fix-module-could-not-be-resolved-from-source-python-linter-errors/</guid><description>&lt;p&gt;Last week, I mentioned that I had &lt;a href="https://ashlynnantrobus.dev/posts/know-when-to-quit/"&gt;put aside the problem of MyPy not being able to follow my module imports&lt;/a&gt; because it was dragging down my productivity and I couldn&amp;rsquo;t find someone to ask.&lt;/p&gt;&#10;&lt;p&gt;I found someone to ask, and it took longer to ask than to get a fix.&lt;/p&gt;&#10;&lt;p&gt;If you are having a similar problem where your linter can&amp;rsquo;t resolve module imports here&amp;rsquo;s the fix:&lt;/p&gt;&#10;&lt;h2 id="project-root-vs-package-root"&gt;Project root vs package root&lt;/h2&gt;&#10;&lt;p&gt;When you start a new project in VS Code and start saving files, the directory you are in is your project root. On my Windows laptop, I always put everything in a vscode folder of my user folder, so for my LoreBinders project, the project root is&lt;/p&gt;</description></item><item><title>How to become a programmer with dyslexia</title><link>https://ashlynnantrobus.dev/posts/how-to-become-a-programmer-with-dyslexia/</link><pubDate>Thu, 13 Jun 2024 21:57:29 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/how-to-become-a-programmer-with-dyslexia/</guid><description>&lt;p&gt;I was first diagnosed with dyslexia in my mid-thirties. I have what would be considered &amp;ldquo;stealth&amp;rdquo; or &amp;ldquo;mild&amp;rdquo; dyslexia which is how I managed to not realize it for three decades.&lt;/p&gt;&#10;&lt;p&gt;What is dyslexia like? It&amp;rsquo;s a little different for everyone, and there are different types. In fact, nobody can quite agree what the different types are. Some researchers will classify dyslexia by deficit, while others by brain activity. Confusing isn&amp;rsquo;t it?&lt;/p&gt;</description></item><item><title>Know when to quit</title><link>https://ashlynnantrobus.dev/posts/know-when-to-quit/</link><pubDate>Tue, 11 Jun 2024 03:47:59 +0000</pubDate><guid>https://ashlynnantrobus.dev/posts/know-when-to-quit/</guid><description>&lt;p&gt;&lt;em&gt;How&amp;rsquo;s that for a first post?&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;New developers will often spend too much time trying to figure out a problem they are stuck on, long past the point they should have asked for help. I recently found myself in that position and wasted an entire week.&lt;/p&gt;&#10;&lt;p&gt;The worst part? It wasn&amp;rsquo;t even code itself that I was stuck on, but a &lt;em&gt;tool&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p&gt;I started implementing type hints in my code fairly early on, in an endeavor to make it more readable, if to myself if to no one else. But they were just that. I didn&amp;rsquo;t have any tooling in place to take advantage of them. But I&amp;rsquo;ve been slowly adding DevOps tooling into my workflow, building out the CI/CD pipelines that will help make me a better developer. DevOps is apparently a controversial topic in the programming world, but I can&amp;rsquo;t imagine why I wouldn&amp;rsquo;t want automated tools that help improve the quality of the code I put out into the world.&lt;/p&gt;</description></item></channel></rss>