Software Engineering
But now we are only logging that error message. It would be better to define a custom Exception that we can then handle in our API in order to return a specific error code to the user:
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be... See more
import pandas as pd
import logging
class DataLoadError(Exception):
"""Exception raised when the data cannot be loaded."""
def __init__(self, message="Data could not be... See more
How to Write Clean Code in Python
And then, in the primary function of your API:
try:
df = load_data('path/to/data.csv')
# Further processing and model prediction
except DataLoadError as e:
# Return a response to the user with the error message
# For example: return Response({"error": str(e)}, status=400)More than reading popular books on Design Patterns, two things that helped me write and structure a large codebase better were
reading a lot of good open source codebases (with similar stack)coding and collaborating a lot on the same codebase
I understand the importance of reading general-purpose design patterns, but they might not suit your... See more
reading a lot of good open source codebases (with similar stack)coding and collaborating a lot on the same codebase
I understand the importance of reading general-purpose design patterns, but they might not suit your... See more
How to get better at writing and structuring a large codebase?
Build & Deployments
Our build process starts by pushing changes to a repository on GitHub. When code is pushed to a repository through a pull request, it triggers a job to build the changes made to the branch and deploy them in isolation. This worklow happens interactively within the pull request, where the author has visibility of all steps.
Some... See more
Our build process starts by pushing changes to a repository on GitHub. When code is pushed to a repository through a pull request, it triggers a job to build the changes made to the branch and deploy them in isolation. This worklow happens interactively within the pull request, where the author has visibility of all steps.
Some... See more
How we approach CI/CD · Resend
Use nested objects for future extensibility
A follow on from the previous tip: try to logically group fields together. The following:
customer.address = {
line1: "Main Street 123",
city: "San Francisco",
postal_code: "12345"
};
Enter fullscreen mode
Exit fullscreen mode
is much cleaner than:
customer.address_line1 = "Main street 123";
customer.address_city... See more
A follow on from the previous tip: try to logically group fields together. The following:
customer.address = {
line1: "Main Street 123",
city: "San Francisco",
postal_code: "12345"
};
Enter fullscreen mode
Exit fullscreen mode
is much cleaner than:
customer.address_line1 = "Main street 123";
customer.address_city... See more
Common Design Patterns at Stripe
Why is Continuous Delivery for ML/AI hard(er)?
Since the challenge is not new and many valid solutions exist targeting traditional software projects, is there a reason to treat ML/AI systems any differently? Consider these three core challenges that are endemic in ML, AI, and data projects:
Since the challenge is not new and many valid solutions exist targeting traditional software projects, is there a reason to treat ML/AI systems any differently? Consider these three core challenges that are endemic in ML, AI, and data projects:
- Development and debugging cycles are more tedious due to
How To Organize Continuous Delivery of ML/AI Systems: a 10-Stage Maturity Model | Outerbounds
Each log message in the system should be unique.
If I query for a log in a specfic service, I will be confused to see the exact same logs at different flows inside the service.
More than that, I’ll just have to start debugging for the issue, since the logs are now offically useless.
One way to keep the logs unique is to denote the service name and... See more
If I query for a log in a specfic service, I will be confused to see the exact same logs at different flows inside the service.
More than that, I’ll just have to start debugging for the issue, since the logs are now offically useless.
One way to keep the logs unique is to denote the service name and... See more
Logging practices I follow
- Solution : Apply the Single Responsibility Principle - each microservice should focus on one single capability that it masters.
- Benefits : This specialization makes microservices easier to comprehend, test, scale, and upgrade. It's like having a coordinated team where each member excels at their role.
- Pitfalls : Violating this principle leads to
Muaath Bin Ali • Microservices Design Principles
We ship early
We constantly review the scope of a project and work toward a v0, not a v1.
That means identifying the most crucial part of a functionality , and pushing the smallest pull request possible to make that happen. In fact, a PR should always be optimized for the speed with which we can merge it in.
We constantly review the scope of a project and work toward a v0, not a v1.
That means identifying the most crucial part of a functionality , and pushing the smallest pull request possible to make that happen. In fact, a PR should always be optimized for the speed with which we can merge it in.
How we ship new features · Resend
Loose Coupling and High Cohesion: How To Avoid Tight Coupling and Low Cohesion?
Cohesion is a measure of the number of relationships that parts of a component have with each other.
High cohesion means that : All of the parts that are needed to deliver the component's functionality are included in the component.
Coupling is a measure of the number of... See more
Cohesion is a measure of the number of relationships that parts of a component have with each other.
High cohesion means that : All of the parts that are needed to deliver the component's functionality are included in the component.
Coupling is a measure of the number of... See more