Burak Blog's

Description about subjects I'm interested


Dataframe factory

Introduction

About a year ago, I made a switch at work and hopped onto the data scientist team. It was a bit of a wild ride getting into the AI scene, figuring out how things are built and coded.

As time rolled on, I noticed something odd – not many folks were big on testing. It was like the norm was to cook up your code and give it a spin with production data. Now, coming from a software development background, that felt a bit off. How on earth do you make sure you cover all those possible use cases without a solid testing game? I’ve got a shortlist of things I can’t stand in this world, and right at the top are messy organization, a lack of basic object-oriented principles, and, you guessed it, no testing.

Read more...

Enhancing Code Quality with Abstract Classes: The Power of Abstraction

Introduction

In the world of object-oriented programming, abstract classes play a crucial role in improving code quality, promoting code reuse, and enabling flexible design. By encapsulating common behavior and providing a blueprint for derived classes, abstract classes facilitate the creation of well-organized, maintainable, and extensible code. In this article, we will explore the benefits of using abstract classes to enhance code and demonstrate how they contribute to building efficient and robust software solutions.

Read more...

Django and testing

Table of Contents

  1. Backstory
  2. How to adjust testing pattern over time
  3. Run pytest

Backstory

In 10 years of career in software development, I’ve seen great applications develop with good intention from developers with deeply or badly writing tests.

Most of the projects I’ve works, tests was develop with unittest to mock functions or methods behaviour. Unittest by itself isn’t the problem, I will say the way the developers use unittest isn’t correct. Let me clarify, unittest is good to test a function or subsets of behaviour but aren’t excellent to dealing when the test requires a database or a caching system like Redis for example. Let’s keep this short, unittest in python aren’t suitable for complex testing.

Read more...

Pythonic

Table of Contents

  1. Pythonic
  2. Context Managers
  3. Slicing
  4. Conclusion

Pythonic

Writing code isn’t hard but writing code that is clean, concise, and maintainable that follows the convention of the Python community is harder. They are a lot of different ways to implement the same function, class, or feature. Some of them are clean, sometimes confusing, or really bad writing that is hard to understand what it does exactly but in the end, the goal is to have a code that follows and naturally flows more in Python conventions and good practices. That is the kind of code we want to write or wish often when we work and are satisfied at the end of the day with our work. That’s what I’m going to try to help to write pythonic code and some python mechanics that can be very helpful.

Read more...
1 of 1