AI module import dependency graph

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

AI module import dependency graph

#1 Post by Cjkjvfnby »

I plan to do a little refactoring. To check which module depends on which I build a dependency graph.
It shows which modules will be affected when you change one.

I post this graph just to track AI progress through the years.

I will pay additional attention to the dependency management when will write and review code.

Building graph:

Code: Select all

pip install pydeps==1.9.0
cd freeorion/default/python/
pydeps AI/FreeOrionAI.py  --include-missing  --cluster --max-cluster-size 10 --min-cluster-size 2 -x collections.* ctypes multiprocessing.* asyncio.* importlib logging freeOrionAIInterface statprof

Graphviz online
Attachments
import-deps.png
import-deps.png (126.48 KiB) Viewed 1809 times
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: AI module import dependency graph

#2 Post by adrian_broher »

Seems like the class dependencies are all over the place (no different than the C++ code to be honest).

> I post this graph just to track AI progress through the years.

So this is the initial state for now?

Does this graph also include the unit test code?
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: AI module import dependency graph

#3 Post by Cjkjvfnby »

adrian_broher wrote: Mon Apr 27, 2020 8:24 am Seems like the class dependencies are all over the place (no different than the C++ code to be honest).
Same people? It took me 10 years to start thinking about architecture :)

> I post this graph just to track AI progress through the years.

So this is the initial state for now?
Yes, it is.
Does this graph also include the unit test code?
No, AI does not have dependencies on test code.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: AI module import dependency graph

#4 Post by Vezzra »

Ouch, that does not look... very pretty.

Post Reply