Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.
Moderator: Committer
Cjkjvfnby
AI Contributor
Posts: 539 Joined: Tue Jun 24, 2014 9:55 pm
#1
Post
by Cjkjvfnby » Sun Apr 26, 2020 10:44 pm
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 (126.48 KiB) Viewed 1870 times
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
adrian_broher
Programmer
Posts: 1156 Joined: Fri Mar 01, 2013 9:52 am
Location: Germany
#2
Post
by adrian_broher » 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).
> 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
Cjkjvfnby
AI Contributor
Posts: 539 Joined: Tue Jun 24, 2014 9:55 pm
#3
Post
by Cjkjvfnby » Wed Apr 29, 2020 9:07 pm
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
Vezzra
Release Manager, Design
Posts: 6102 Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III
#4
Post
by Vezzra » Fri May 01, 2020 2:28 pm
Ouch, that does not look... very pretty.