netlistx 0.1__tar.gz → 0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netlistx-0.2/GEMINI.md +80 -0
- {netlistx-0.1/src/netlistx.egg-info → netlistx-0.2}/PKG-INFO +1 -1
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/graph_algo.py +1 -1
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/netlist.py +5 -17
- {netlistx-0.1 → netlistx-0.2/src/netlistx.egg-info}/PKG-INFO +1 -1
- {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/SOURCES.txt +1 -0
- {netlistx-0.1 → netlistx-0.2}/tox.ini +1 -0
- {netlistx-0.1 → netlistx-0.2}/.coveragerc +0 -0
- {netlistx-0.1 → netlistx-0.2}/.flake8 +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/ci.backup +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/jekyll-gh-pages.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/multi-platforms.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-app.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-package.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-publish.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.gitignore +0 -0
- {netlistx-0.1 → netlistx-0.2}/.isort.cfg +0 -0
- {netlistx-0.1 → netlistx-0.2}/.markdownlint.yaml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.pre-commit-config.yaml +0 -0
- {netlistx-0.1 → netlistx-0.2}/.readthedocs.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/AUTHORS.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/CHANGELOG.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/CONTRIBUTING.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/LICENSE +0 -0
- {netlistx-0.1 → netlistx-0.2}/LICENSE.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/README.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/_config.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/Makefile +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/_static/.gitignore +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/authors.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/changelog.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/conf.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/contributing.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/index.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/license.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/license.rst +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/readme.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/docs/requirements.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/environment.yml +0 -0
- {netlistx-0.1 → netlistx-0.2}/mypy.ini +0 -0
- {netlistx-0.1 → netlistx-0.2}/oryx-build-commands.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/pyproject.toml +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements/README.md +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements/default.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements/doc.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements/extras.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements/test.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/requirements.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/setup.cfg +0 -0
- {netlistx-0.1 → netlistx-0.2}/setup.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/__init__.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/cover.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/netlist_algo.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx/skeleton.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/dependency_links.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/not-zip-safe +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/requires.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/top_level.txt +0 -0
- {netlistx-0.1 → netlistx-0.2}/testcases/drawf.json +0 -0
- {netlistx-0.1 → netlistx-0.2}/testcases/fix.json +0 -0
- {netlistx-0.1 → netlistx-0.2}/testcases/p1.json +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/conftest.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/test_graph_algo.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/test_inverter.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/test_netlist.py +1 -1
- {netlistx-0.1 → netlistx-0.2}/tests/test_netlist_algo.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/test_networkx.py +0 -0
- {netlistx-0.1 → netlistx-0.2}/tests/test_skeleton.py +0 -0
netlistx-0.2/GEMINI.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# GEMINI.md
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
This project is a Python library named `netlistx`. Its purpose is to provide tools for working with netlists, which are representations of electronic circuits. The library defines classes and functions for creating, manipulating, and analyzing netlists, leveraging graph theory concepts and the `networkx` library.
|
|
6
|
+
|
|
7
|
+
The core of the library is the `Netlist` class, which represents a circuit as a graph of modules (components) and nets (wires). It also includes various algorithms for solving graph problems, such as finding minimum covers for edges and cycles.
|
|
8
|
+
|
|
9
|
+
The project is structured as a standard Python package using `pyscaffold`.
|
|
10
|
+
|
|
11
|
+
## Building and Running
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
The main dependencies are `networkx` and `mywheel` (a custom library from a git repository). Development and testing dependencies include `pytest`, `flake8`, `black`, `isort`, and `tox`.
|
|
16
|
+
|
|
17
|
+
### Building the Package
|
|
18
|
+
|
|
19
|
+
To build the source and wheel distributions:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
tox -e build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The artifacts will be placed in the `dist/` directory.
|
|
26
|
+
|
|
27
|
+
### Running Tests
|
|
28
|
+
|
|
29
|
+
The project uses `pytest` for testing and `tox` to automate the process. To run the test suite:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
tox
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
or simply:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pytest
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Linting
|
|
42
|
+
|
|
43
|
+
The project uses `flake8` for linting. The CI pipeline runs the following command:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Development Conventions
|
|
50
|
+
|
|
51
|
+
The project follows standard Python development conventions and uses several tools to enforce code quality and style.
|
|
52
|
+
|
|
53
|
+
### Code Style
|
|
54
|
+
|
|
55
|
+
* **Formatting:** `black` is used for code formatting.
|
|
56
|
+
* **Import Sorting:** `isort` is used to organize imports.
|
|
57
|
+
* **Linting:** `flake8` is used to check for style and quality issues.
|
|
58
|
+
|
|
59
|
+
These checks are automated using `pre-commit` hooks, which are configured in `.pre-commit-config.yaml`. Contributors are expected to install and use these hooks.
|
|
60
|
+
|
|
61
|
+
### Contribution Guidelines
|
|
62
|
+
|
|
63
|
+
Detailed contribution guidelines are provided in `CONTRIBUTING.md`. The workflow involves:
|
|
64
|
+
|
|
65
|
+
1. Forking the repository.
|
|
66
|
+
2. Creating a feature branch.
|
|
67
|
+
3. Installing dependencies and `pre-commit` hooks.
|
|
68
|
+
4. Making changes, including adding tests and documentation.
|
|
69
|
+
5. Running tests with `tox`.
|
|
70
|
+
6. Submitting a pull request.
|
|
71
|
+
|
|
72
|
+
### Documentation
|
|
73
|
+
|
|
74
|
+
The documentation is built using `Sphinx` and can be generated by running:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
tox -e docs
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The output will be in `docs/_build/html`.
|
|
@@ -31,18 +31,6 @@ from networkx.algorithms import bipartite
|
|
|
31
31
|
from networkx.readwrite import json_graph
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
# The `ThinGraph` class is a subclass of `nx.Graph` that defines default attributes for edges and
|
|
35
|
-
# nodes.
|
|
36
|
-
class ThinGraph(nx.Graph):
|
|
37
|
-
all_edge_dict = {"weight": 1}
|
|
38
|
-
|
|
39
|
-
def single_edge_dict(self):
|
|
40
|
-
return self.all_edge_dict
|
|
41
|
-
|
|
42
|
-
edge_attr_dict_factory = single_edge_dict
|
|
43
|
-
node_attr_dict_factory = single_edge_dict
|
|
44
|
-
|
|
45
|
-
|
|
46
34
|
# The class SimpleGraph is a subclass of nx.Graph and defines default attributes for edges and nodes.
|
|
47
35
|
class SimpleGraph(nx.Graph):
|
|
48
36
|
all_edge_dict = {"weight": 1}
|
|
@@ -227,7 +215,7 @@ def read_json(filename):
|
|
|
227
215
|
|
|
228
216
|
|
|
229
217
|
def create_inverter():
|
|
230
|
-
gr =
|
|
218
|
+
gr = SimpleGraph()
|
|
231
219
|
gr.add_nodes_from(["a0", "p1", "p2", "n0", "n1"])
|
|
232
220
|
nets = ["n0", "n1"]
|
|
233
221
|
modules = ["a0", "p1", "p2"]
|
|
@@ -252,7 +240,7 @@ def create_inverter():
|
|
|
252
240
|
|
|
253
241
|
|
|
254
242
|
def create_inverter2():
|
|
255
|
-
gr =
|
|
243
|
+
gr = SimpleGraph()
|
|
256
244
|
gr.add_nodes_from([0, 1, 2, 3, 4])
|
|
257
245
|
nets = range(3, 5)
|
|
258
246
|
modules = range(3)
|
|
@@ -280,10 +268,10 @@ def create_drawf():
|
|
|
280
268
|
"""
|
|
281
269
|
The function `create_drawf` creates a graph and netlist object with specified nodes, edges, and
|
|
282
270
|
weights.
|
|
283
|
-
:return: an instance of the Netlist class, which is created using the
|
|
271
|
+
:return: an instance of the Netlist class, which is created using the SimpleGraph class and some
|
|
284
272
|
predefined modules and nets.
|
|
285
273
|
"""
|
|
286
|
-
ugraph =
|
|
274
|
+
ugraph = SimpleGraph()
|
|
287
275
|
ugraph.add_nodes_from(
|
|
288
276
|
[
|
|
289
277
|
"a0",
|
|
@@ -349,7 +337,7 @@ def create_test_netlist():
|
|
|
349
337
|
weights.
|
|
350
338
|
:return: an instance of the `Netlist` class, which represents a netlist with modules and nets.
|
|
351
339
|
"""
|
|
352
|
-
ugraph =
|
|
340
|
+
ugraph = SimpleGraph()
|
|
353
341
|
ugraph.add_nodes_from(["a0", "a1", "a2", "a3", "a4", "a5"])
|
|
354
342
|
# module_weight = [533, 543, 532]
|
|
355
343
|
module_weight = {"a0": 533, "a1": 543, "a2": 532}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|