All Questions
15 questions
2
votes
2
answers
562
views
Is this architecture overkill? What is a good way to architect this software?
I have an algorithm I am trying to implement that has steps 1 to 5. There are several different ways I could implement each step. Each calculation step is essentially just an astronomy calculation, ...
1
vote
1
answer
314
views
Where to create repository instances?
I've several repositories. To make them testable, I add the ORM session in the constructor.
class Repository:
def __init__(session):
self.session = session
def save(object):
self.session()...
-1
votes
1
answer
899
views
Subclasses with same behaviour but different attributes for different inputs
Say I have two object types of the same interface MyObj (I am using python in this project so I will use the same for the explanation)
class Foo(MyObj):
a = [5, 10]
class Bar(MyObj):
a = [[1, ...
-2
votes
2
answers
1k
views
Best practice: keep DB models in one file or split into modules?
I've a Python project with ~30 SQLAlchemy models and I'm not sure where they belong. All models belong to the DB but also to a module, so I'm not sure about the right namespace.
Here are some ideas:
...
2
votes
1
answer
507
views
Converter implementation in Python: class versus module?
I've written a little library that uses the builtin ast library to convert between functions, docstrings, argparse .add_argument, classes, and [soon] more.
Stubs look something like this, with ir ...
0
votes
2
answers
712
views
User-friendly parameter parsing from yaml
Problem
I have designed an evaluation tool (in python) and need some help to make it more user friendly. The tool requires ~100 (nested) parameters, which it gets from a yaml file and stores ...
1
vote
1
answer
298
views
mongodb queries architecture - resolving lots of nested referenced objects
I have an angular 8 application, with a Python + MongoDB API on the backend.
At present, I have 4 collections, namely: Users, Tasks, Companies and Groups.
All of these resource types are retrievable ...
4
votes
2
answers
459
views
Data processing pipeline design for processing data
I have a use case for which I need to build a data processing pipeline
Customer contact leads data coming from different data sources like csv, data base, api has to be first mapped to a universal ...
17
votes
3
answers
30k
views
best way to install local package into docker image
I have a python package that I wrote and I want to use it within multiple docker builds.
However, I can't just install my local package situated outside of Dockerfile folder. And I don't want to ...
2
votes
2
answers
74
views
Relating to design and runtime - is it better to parallelize smaller sub-tasks or bundled tasks?
I'm programming a small web scraper in python which I want to speed up by parallelizing things. The scraper is crawling URLs whereby a single URL can represent an 'item' or an 'index'. An index in ...
8
votes
2
answers
4k
views
how to refactor many singletons
I have a medium-sized python program (~5000 lines of code), which I've built up over time, with no particular plan as I went ahead. The architecture I've ended up with consists of 5-6 large Singleton ...
4
votes
1
answer
234
views
How should I represent composeable, associative computations to be repeatedly applied to units of data?
Spoiler
My question is the following: Are there any design patterns for representing chainable functions that are for the problem described below?
High-Level Decription of the Process
I'm currently ...
2
votes
2
answers
7k
views
Model-View-Controller -- Where does a factory class go?
I'm working (slowly) on a small Flask project. One of my models is a class called Post, which is a lightweight namedtuple. Post objects are created by a PostFactory, because creating a Post involves ...
5
votes
1
answer
4k
views
How to design a composite pattern in Python?
The concept
I'm programming an interface over pygame as a personal project, to make the creation of games easier for me.
So far I managed to design an architecture that behaves like this :
Objects ...
5
votes
1
answer
6k
views
How should I architect a personal schedule manager that runs 24/7? [closed]
I've developed an ADHD management system for myself that's attempting to change multiple habits at once. I know this is counter to conventional wisdom, but I've tried the conventional for years & ...