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.
Files changed (68) hide show
  1. netlistx-0.2/GEMINI.md +80 -0
  2. {netlistx-0.1/src/netlistx.egg-info → netlistx-0.2}/PKG-INFO +1 -1
  3. {netlistx-0.1 → netlistx-0.2}/src/netlistx/graph_algo.py +1 -1
  4. {netlistx-0.1 → netlistx-0.2}/src/netlistx/netlist.py +5 -17
  5. {netlistx-0.1 → netlistx-0.2/src/netlistx.egg-info}/PKG-INFO +1 -1
  6. {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/SOURCES.txt +1 -0
  7. {netlistx-0.1 → netlistx-0.2}/tox.ini +1 -0
  8. {netlistx-0.1 → netlistx-0.2}/.coveragerc +0 -0
  9. {netlistx-0.1 → netlistx-0.2}/.flake8 +0 -0
  10. {netlistx-0.1 → netlistx-0.2}/.github/workflows/ci.backup +0 -0
  11. {netlistx-0.1 → netlistx-0.2}/.github/workflows/jekyll-gh-pages.yml +0 -0
  12. {netlistx-0.1 → netlistx-0.2}/.github/workflows/multi-platforms.yml +0 -0
  13. {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-app.yml +0 -0
  14. {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-package.yml +0 -0
  15. {netlistx-0.1 → netlistx-0.2}/.github/workflows/python-publish.yml +0 -0
  16. {netlistx-0.1 → netlistx-0.2}/.gitignore +0 -0
  17. {netlistx-0.1 → netlistx-0.2}/.isort.cfg +0 -0
  18. {netlistx-0.1 → netlistx-0.2}/.markdownlint.yaml +0 -0
  19. {netlistx-0.1 → netlistx-0.2}/.pre-commit-config.yaml +0 -0
  20. {netlistx-0.1 → netlistx-0.2}/.readthedocs.yml +0 -0
  21. {netlistx-0.1 → netlistx-0.2}/AUTHORS.md +0 -0
  22. {netlistx-0.1 → netlistx-0.2}/CHANGELOG.md +0 -0
  23. {netlistx-0.1 → netlistx-0.2}/CONTRIBUTING.md +0 -0
  24. {netlistx-0.1 → netlistx-0.2}/LICENSE +0 -0
  25. {netlistx-0.1 → netlistx-0.2}/LICENSE.txt +0 -0
  26. {netlistx-0.1 → netlistx-0.2}/README.md +0 -0
  27. {netlistx-0.1 → netlistx-0.2}/_config.yml +0 -0
  28. {netlistx-0.1 → netlistx-0.2}/docs/Makefile +0 -0
  29. {netlistx-0.1 → netlistx-0.2}/docs/_static/.gitignore +0 -0
  30. {netlistx-0.1 → netlistx-0.2}/docs/authors.md +0 -0
  31. {netlistx-0.1 → netlistx-0.2}/docs/changelog.md +0 -0
  32. {netlistx-0.1 → netlistx-0.2}/docs/conf.py +0 -0
  33. {netlistx-0.1 → netlistx-0.2}/docs/contributing.md +0 -0
  34. {netlistx-0.1 → netlistx-0.2}/docs/index.md +0 -0
  35. {netlistx-0.1 → netlistx-0.2}/docs/license.md +0 -0
  36. {netlistx-0.1 → netlistx-0.2}/docs/license.rst +0 -0
  37. {netlistx-0.1 → netlistx-0.2}/docs/readme.md +0 -0
  38. {netlistx-0.1 → netlistx-0.2}/docs/requirements.txt +0 -0
  39. {netlistx-0.1 → netlistx-0.2}/environment.yml +0 -0
  40. {netlistx-0.1 → netlistx-0.2}/mypy.ini +0 -0
  41. {netlistx-0.1 → netlistx-0.2}/oryx-build-commands.txt +0 -0
  42. {netlistx-0.1 → netlistx-0.2}/pyproject.toml +0 -0
  43. {netlistx-0.1 → netlistx-0.2}/requirements/README.md +0 -0
  44. {netlistx-0.1 → netlistx-0.2}/requirements/default.txt +0 -0
  45. {netlistx-0.1 → netlistx-0.2}/requirements/doc.txt +0 -0
  46. {netlistx-0.1 → netlistx-0.2}/requirements/extras.txt +0 -0
  47. {netlistx-0.1 → netlistx-0.2}/requirements/test.txt +0 -0
  48. {netlistx-0.1 → netlistx-0.2}/requirements.txt +0 -0
  49. {netlistx-0.1 → netlistx-0.2}/setup.cfg +0 -0
  50. {netlistx-0.1 → netlistx-0.2}/setup.py +0 -0
  51. {netlistx-0.1 → netlistx-0.2}/src/netlistx/__init__.py +0 -0
  52. {netlistx-0.1 → netlistx-0.2}/src/netlistx/cover.py +0 -0
  53. {netlistx-0.1 → netlistx-0.2}/src/netlistx/netlist_algo.py +0 -0
  54. {netlistx-0.1 → netlistx-0.2}/src/netlistx/skeleton.py +0 -0
  55. {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/dependency_links.txt +0 -0
  56. {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/not-zip-safe +0 -0
  57. {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/requires.txt +0 -0
  58. {netlistx-0.1 → netlistx-0.2}/src/netlistx.egg-info/top_level.txt +0 -0
  59. {netlistx-0.1 → netlistx-0.2}/testcases/drawf.json +0 -0
  60. {netlistx-0.1 → netlistx-0.2}/testcases/fix.json +0 -0
  61. {netlistx-0.1 → netlistx-0.2}/testcases/p1.json +0 -0
  62. {netlistx-0.1 → netlistx-0.2}/tests/conftest.py +0 -0
  63. {netlistx-0.1 → netlistx-0.2}/tests/test_graph_algo.py +0 -0
  64. {netlistx-0.1 → netlistx-0.2}/tests/test_inverter.py +0 -0
  65. {netlistx-0.1 → netlistx-0.2}/tests/test_netlist.py +1 -1
  66. {netlistx-0.1 → netlistx-0.2}/tests/test_netlist_algo.py +0 -0
  67. {netlistx-0.1 → netlistx-0.2}/tests/test_networkx.py +0 -0
  68. {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`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netlistx
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Ellipsoid Method in Python
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: Wai-Shing Luk
@@ -75,7 +75,7 @@ def min_vertex_cover_fast(
75
75
 
76
76
  b c d e
77
77
  #-----o-----#-----o
78
- | \ / \
78
+ | \ / \
79
79
  | \ / \
80
80
  o #-----o
81
81
  a e f
@@ -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 = ThinGraph()
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 = ThinGraph()
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 ThinGraph class and some
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 = ThinGraph()
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 = ThinGraph()
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}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: netlistx
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Ellipsoid Method in Python
5
5
  Home-page: https://github.com/pyscaffold/pyscaffold/
6
6
  Author: Wai-Shing Luk
@@ -8,6 +8,7 @@
8
8
  AUTHORS.md
9
9
  CHANGELOG.md
10
10
  CONTRIBUTING.md
11
+ GEMINI.md
11
12
  LICENSE
12
13
  LICENSE.txt
13
14
  README.md
@@ -18,6 +18,7 @@ passenv =
18
18
  extras =
19
19
  testing
20
20
  commands =
21
+ pip install git+https://github.com/luk036/mywheel.git
21
22
  pytest {posargs}
22
23
 
23
24
 
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
@@ -3,8 +3,8 @@ import json
3
3
  from networkx.readwrite import json_graph
4
4
 
5
5
  from netlistx.netlist import (
6
- create_inverter,
7
6
  create_drawf,
7
+ create_inverter,
8
8
  create_random_hgraph,
9
9
  create_test_netlist,
10
10
  read_json,
File without changes
File without changes