Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #205: Quantum dynamics are affecting the transistors


comp / comp.lang.python / How to go about describing my software with a component diagram?

SubjectAuthor
* How to go about describing my software with a component diagram?marc nicole
`- Re: How to go about describing my software with a component diagram?Stefan Ram

1
Subject: How to go about describing my software with a component diagram?
From: marc nicole
Newsgroups: comp.lang.python
Date: Tue, 24 Dec 2024 17:27 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: mk1853387@gmail.com (marc nicole)
Newsgroups: comp.lang.python
Subject: How to go about describing my software with a component diagram?
Date: Tue, 24 Dec 2024 18:27:21 +0100
Lines: 15
Message-ID: <mailman.16.1735061172.2912.python-list@python.org>
References: <CAGJtH9SeSw6CJEgs37MQ9DJEADeQy4M_bAYPH1yeFiJN+mTLYQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de ly6GsCGFgjWWWWek13gLlAU1UzJIEMnGAV/aJW5q1/Og==
Cancel-Lock: sha1:Hv3b3hxszmwb1LQIOKF7Y2IJs8A= sha256:BS5YBHaZFM3SxwOxemakv/ABZGI+nUfBEmmcuSVdJII=
Return-Path: <mk1853387@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=SuS6T94G;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.016
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'modules': 0.07;
'describe': 0.09; 'filename:fname piece:PNG': 0.09; 'importing':
0.16; 'python': 0.16; 'uses': 0.19; 'to:addr:python-list': 0.20;
'to:no real name:2**1': 0.22; 'code': 0.23; 'thanks!': 0.24;
'community,': 0.28; 'sfxlen:2': 0.31; 'subject:How': 0.31;
'message-id:@mail.gmail.com': 0.31; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.34; 'following': 0.35; 'main': 0.37;
'could': 0.37; 'skip:u 20': 0.39; 'improved': 0.64
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1735061169; x=1735665969; darn=python.org;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=hNx5nokUodx2c/seFpMyexwEH1JuBMXx+esYy25uR/4=;
b=SuS6T94Gl9H8qk35XxOgDy+V5Vz+r62SKdkR4eo/8CGg1fbCKLSV/g/rMDBDNsSrby
16Lwaa1moodY5hBnYLvB/DnbmefA+h751inp3ouIL/Zmjo7xA/kA6PLaIniM/BfA917d
RmKYkwdYIWCDcRAt0IjTR5MbU/n3EzCkywE6IVFDGFdTUDsk4SUxuAdzk/DZbxlgJFEH
owuM4KAdyZmKZfNjq1DFGdHgbPGzR3C+0fQN0qsSLhrjAYhMYWJWKJMvD9b4I+TERqEf
R6eI+/+JKWDaxdQGoXnVE+ZOeAnTNGJbkreOQb4PgnmPnZEf6Fkm9+UwjiuDh3hi9IUf
Pw/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1735061169; x=1735665969;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=hNx5nokUodx2c/seFpMyexwEH1JuBMXx+esYy25uR/4=;
b=gAwC9zy1FVWsYOYYMDIWXxqs/2CUpObTWLdkFIOWtGo3IU9L5x3HqCdmTY+n1oz3k9
wC2KH5eLJmYN9JpGgulsIxSK2WXpmAIq8LSO/vsdSHWerhnEiSXgbYSy0pgtiQLu44o/
nYuJslt++kiK9/ifhZkcLKtxo9txdTIl5nttaLCX6NmYku4xmKRlwqBB9nJcGP0SIN4k
Am1akrDhiBF7Md4E4BkGlXvWam8YSKhdMCDlTOSrsbu6zvx8lHMh8b+kIGQ+hII+HnOn
pDnUQTm8Gg4fHDqYYNZqA/DKqu1sVW73fTVPO+C9wj726GSnE4UHCta+rIBQqtrGSgZe
qtcw==
X-Forwarded-Encrypted: i=1;
AJvYcCUGwVMmdT52jdMtX3yBqHrXB4TWTO0v3o5/oZ7s6RwjyBPJ+8/KisAZiLnWtKiib73aDuHyWY5cu/YVMw==@python.org
X-Gm-Message-State: AOJu0YwEhiveyKzyo2rx5NciTX+ZFEJ5kGL2Jp9sc/kTYmrjblSYGVhd
1VyXKFtE10rVfa5wugVe4Dznn0C8Kwc4NJDseOHguTbUcd40DLvWlPVED0FXVttknYl/lmYvBdy
Tkpm4nmKZI94HWfTRA204taNdV/kQ3QqhbuU=
X-Gm-Gg: ASbGncuXxev90tk45Mqa7IVj7TsRguCotm7hc4k1j4a/mHJrRnM0O4sYTqCPmswyBrJ
fDCtM2hu8RtM4Iyyfncbghh2lk6He9J4F9qX2+A==
X-Google-Smtp-Source: AGHT+IHvS0FPrH8bv31qEFBhEYvA1o/iQKAvuObC198fcUjW6VqlILW9UGsxGcmH74EJBnMg5HI4zgiidYvU3zNYGjg=
X-Received: by 2002:a25:5887:0:b0:e4e:723f:cad6 with SMTP id
3f1490d57ef6-e538c25723bmr9908274276.17.1735061168698; Tue, 24 Dec 2024
09:26:08 -0800 (PST)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAGJtH9SeSw6CJEgs37MQ9DJEADeQy4M_bAYPH1yeFiJN+mTLYQ@mail.gmail.com>
View all headers

Hello community,

I have created a Python code where a main algorithm uses three different
modules (.py) after importing them.

To illustrate and describe it I have created the following component
diagram?

[image: checkso.PNG]

Could it be improved for better description and readability?

Thanks!

Subject: Re: How to go about describing my software with a component diagram?
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Tue, 24 Dec 2024 17:35 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: How to go about describing my software with a component diagram?
Date: 24 Dec 2024 17:35:32 GMT
Organization: Stefan Ram
Lines: 125
Expires: 1 Jan 2026 11:59:58 GMT
Message-ID: <diagram-20241224183440@ram.dialup.fu-berlin.de>
References: <CAGJtH9SeSw6CJEgs37MQ9DJEADeQy4M_bAYPH1yeFiJN+mTLYQ@mail.gmail.com> <mailman.16.1735061172.2912.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de WPFvW9VTBUw6zt5gNrWOAQ+RP2QmLy0INqGEkBdllN5PDN
Cancel-Lock: sha1:rQaAREFJvqBtW8ssMeye5WhPDgo= sha256:Eh5XgvxKmDctp1CUxu+7WgTV2Kp27bVVzhRg2kw690Q=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

marc nicole <mk1853387@gmail.com> wrote or quoted:
>Could it be improved for better description and readability?

ASCII art is very readable in Usenet.

With Unicode:

┌─────────────────┐ ┌─────────────────┐
│ Component A │ │ Component B │
│ │ │ │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Interface │<>┼──────┼─>│ Interface │ │
│ └───────────┘ │ │ └───────────┘ │
│ │ │ │
└─────────────────┘ └─────────────────┘
│ │
│ │
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Component C │ │ Component D │
│ │ │ │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Interface │<>┼──────┼─>│ Interface │ │
│ └───────────┘ │ │ └───────────┘ │
│ │ │ │
└─────────────────┘ └─────────────────┘

With plain ASCII:

..----------------. .----------------.
| Component A | | Component B |
| | | |
| .-----------. | | .-----------. |
| | Interface |<+------+->| Interface | |
| '-----------' | | '-----------' |
| | | |
'----------------' '----------------'
| |
| |
| |
v v
..----------------. .----------------.
| Component C | | Component D |
| | | |
| .-----------. | | .-----------. |
| | Interface |<+------+->| Interface | |
| '-----------' | | '-----------' |
| | | |
'----------------' '----------------'

With turtles (there are some errors, but one get's the idea!):

import turtle

def draw_box(t, width, height):
for _ in range(2):
t.forward(width)
t.right(90)
t.forward(height)
t.right(90)

def draw_component(t, x, y, label):
t.penup()
t.goto(x, y)
t.pendown()
draw_box(t, 160, 100)

# Draw interface
t.penup()
t.goto(x + 20, y - 40)
t.pendown()
draw_box(t, 120, 30)

# Write component label
t.penup()
t.goto(x + 80, y + 70)
t.write(label, align="center", font=("Arial", 12, "normal"))

def draw_arrow(t, start_x, start_y, end_x, end_y):
t.penup()
t.goto(start_x, start_y)
t.pendown()
t.goto(end_x, end_y)

# Draw arrowhead
t.setheading(t.towards(end_x, end_y))
t.right(150)
t.forward(10)
t.backward(10)
t.left(300)
t.forward(10)

def main():
screen = turtle.Screen()
screen.setup(800, 600)
screen.title("Component Diagram")

t = turtle.Turtle()
t.speed(0) # Fastest drawing speed

# Draw components
draw_component(t, -200, 150, "Component A")
draw_component(t, 100, 150, "Component B")
draw_component(t, -200, -100, "Component C")
draw_component(t, 100, -100, "Component D")

# Draw arrows
draw_arrow(t, -40, 125, 100, 125)
draw_arrow(t, -120, 50, -120, -100)
draw_arrow(t, 180, 50, 180, -100)
draw_arrow(t, -40, -125, 100, -125)

t.hideturtle()
screen.exitonclick()

if __name__ == "__main__":
main()

1

rocksolid light 0.9.8
clearnet tor