Skip to content

Commit 9a7627a

Browse files
committed
Add project guide and extend project command line
1 parent 5dbb888 commit 9a7627a

15 files changed

+994
-243
lines changed

README.md

Lines changed: 5 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,8 @@ pip install cssfinder[numpy]
6767
pip install cssfinder[rust]
6868
```
6969

70-
You don't need both, one will be perfectly fine. Alternatively, you may find
71-
`cssfinder-backend-numpy` and `cssfinder-backend-rust` on PyPI and install them
72-
manually, with exact same effect. Backends are dynamically detected from all
73-
locations from where Python can import modules, thus any valid way of making
74-
backend code reachable for interpreter will work.
75-
76-
### Development version
77-
78-
To install development version of CSSFinder, you can use `pip` in terminal:
79-
80-
```
81-
pip install git+https://github.com/Argmaster/pygerber
82-
```
83-
84-
### For windows users
85-
86-
CSSFinder can export PDF reports (and other formats too), but it uses
87-
`weasyprint` for that and `weasyprint` relies on `GTK3`. Unfortunately it is
88-
quite hard to get `GTK3` going on windows and `weasyprint` requires it to work.
89-
Therefore you must handle installation yourself.
90-
[Here](https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#windows)
91-
you can find official guidelines from `weasyprint`.
92-
[This repository](https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer)
93-
may also help. Alternatively you can use WSL to install and run CSSFinder, as
94-
its seamless to do that.
95-
96-
Its worth mentioning that other formats are not affected by this issue.
70+
For more detailed description of installation process visit CSSFinder
71+
[online documentation](https://argmaster.github.io/cssfinder/latest/usage/00_installation_guide.md).
9772

9873
## Quick start guide
9974

@@ -131,179 +106,6 @@ main - CSSFinder is a script for finding closest separ
131106

132107
## Development
133108

134-
This project uses `Python` programming language and requires at least python
135-
`3.8` for development and distribution. Development dependencies
136-
[`poetry`](https://pypi.org/project/poetry/) for managing dependencies and
137-
distribution building. It is necessary to perform any operations in development
138-
environment.
139-
140-
To install poetry globally (preferred way) use `pip` in terminal:
141-
142-
```
143-
pip install poetry
144-
```
145-
146-
Then use
147-
148-
```
149-
poetry shell
150-
```
151-
152-
to spawn new shell with virtual environment activated. Virtual environment will
153-
be indicated by terminal prompt prefix `(cssfinder-py3.10)`, version indicated
154-
in prefix depends on used version of Python interpreter. It is not necessary to
155-
use Python 3.10, however at least 3.8 is required.
156-
157-
Within shell with active virtual environment use:
158-
159-
```
160-
poetry install --sync
161-
```
162-
163-
To install all dependencies. Every time you perform a `git pull` or change a
164-
branch, you should call this command to make sure you have the correct versions
165-
of dependencies.
166-
167-
Last line should contain something like:
168-
169-
```
170-
Installing the current project: cssfinder (0.1.0)
171-
```
172-
173-
If no error messages are shown, You are good to go.
174-
175-
## Packaging
176-
177-
A Python Wheel is a built package format for Python that can be easily
178-
installed and distributed, containing all the files necessary to install a
179-
module and can be installed with pip with all dependencies automatically
180-
installed too.
181-
182-
To create wheel of cssfinder use `poe` task in terminal:
183-
184-
```
185-
poe build
186-
```
187-
188-
![poe_build](https://user-images.githubusercontent.com/56170852/223251363-61fc4d00-68ad-429c-9fbb-8ab7f4712451.png)
189-
190-
This will create `dist/` directory with `cssfinder-0.7.0` or alike inside.
191-
192-
Wheel file can be installed with
193-
194-
```
195-
pip install ./dist/cssfinder-0.7.0
196-
```
197-
198-
What you expect is
199-
200-
```
201-
Successfully installed cssfinder-0.7.0
202-
```
203-
204-
or rather something like
205-
206-
```
207-
Successfully installed click-8.1.3 contourpy-1.0.7 cssfinder-0.7.0 cycler-0.11.0 dnspython-2.3.0 email-validator-1.3.1 fonttools-4.39.0 idna-3.4 jsonref-1.1.0 kiwisolver-1.4.4 llvmlite-0.39.1 markdown-it-py-2.2.0 matplotlib-3.7.1 mdurl-0.1.2 numba-0.56.4 numpy-1.23.5 packaging-23.0 pandas-1.5.3 pendulum-2.1.2 pillow-9.4.0 pydantic-1.10.5 pygments-2.14.0 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2022.7.1 pytzdata-2020.1 rich-13.3.2 scipy-1.10.1 six-1.16.0 typing-extensions-4.5.0
208-
```
209-
210-
But `cssfinder-0.7.0` should be included in this list.
211-
212-
## Code quality
213-
214-
To ensure that all code follow same style guidelines and code quality rules,
215-
multiple static analysis tools are used. For simplicity, all of them are
216-
configured as `pre-commit` ([learn about pre-commit](https://pre-commit.com/))
217-
hooks. Most of them however are listed as development dependencies.
218-
219-
- `autocopyright`: This hook automatically adds copyright headers to files. It
220-
is used to ensure that all files in the repository have a consistent
221-
copyright notice.
222-
223-
- `autoflake`: This hook automatically removes unused imports from Python code.
224-
It is used to help keep code clean and maintainable by removing unnecessary
225-
code.
226-
227-
- `docformatter`: This hook automatically formats docstrings in Python code. It
228-
is used to ensure that docstrings are consistent and easy to read.
229-
230-
- `prettier`: This hook automatically formats code in a variety of languages,
231-
including JavaScript, HTML, CSS, and Markdown. It is used to ensure that code
232-
is consistently formatted and easy to read.
233-
234-
- `isort`: This hook automatically sorts Python imports. It is used to ensure
235-
that imports are organized in a consistent and readable way.
236-
237-
- `black`: This hook automatically formats Python code. It is used to ensure
238-
that code is consistently formatted and easy to read.
239-
240-
- `check-merge-conflict`: This hook checks for merge conflicts. It is used to
241-
ensure that code changes do not conflict with other changes in the
242-
repository.
243-
244-
- `check-case-conflict`: This hook checks for case conflicts in file names. It
245-
is used to ensure that file names are consistent and do not cause issues on
246-
case-sensitive file systems.
247-
248-
- `trailing-whitespace`: This hook checks for trailing whitespace in files. It
249-
is used to ensure that files do not contain unnecessary whitespace.
250-
251-
- `end-of-file-fixer`: This hook adds a newline to the end of files if one is
252-
missing. It is used to ensure that files end with a newline character.
253-
254-
- `debug-statements`: This hook checks for the presence of debugging statements
255-
(e.g., print statements) in code. It is used to ensure that code changes do
256-
not contain unnecessary debugging code.
257-
258-
- `check-added-large-files`: This hook checks for large files that have been
259-
added to the repository. It is used to ensure that large files are not
260-
accidentally committed to the repository.
261-
262-
- `check-toml`: This hook checks for syntax errors in TOML files. It is used to
263-
ensure that TOML files are well-formed.
264-
265-
- `mixed-line-ending`: This hook checks for mixed line endings (e.g., a mix of
266-
Windows and Unix line endings) in text files. It is used to ensure that text
267-
files have consistent line endings.
268-
269-
To run all checks, you must install hooks first with poe
270-
271-
```
272-
poe install-hooks
273-
```
274-
275-
After you have once used this command, you wont have to use it in this
276-
environment. Then you can use
277-
278-
```
279-
poe run-hooks
280-
```
281-
282-
To run checks and automatic fixing. Not all issues can be automatically fixed,
283-
some of them will require your intervention.
284-
285-
Successful hooks run should leave no Failed tasks:
286-
287-
![run_hooks_output](https://user-images.githubusercontent.com/56170852/223247968-8333e9ee-c0f0-4cce-afe1-a8e7917d9b0a.png)
288-
289-
Example of failed task:
290-
291-
![failed_task](https://user-images.githubusercontent.com/56170852/223249222-113a1269-fb3c-4d2c-b2ba-3d26e8ac090a.png)
292-
293-
Those hooks will be run also while you try to commit anything. If any tasks
294-
fails, no commit will be created, instead you will be expected to fix errors
295-
and add stage fixes. Then you may retry running `git commit`.
296-
297-
## Profiling
298-
299-
To run simple profiling, You can use following command:
300-
301-
```
302-
python -mcProfile -o "#examples_profile_5qubits_prof.prof" "assets/profiling/5qubits_prof/cssfproject.py"
303-
```
304-
305-
Then You can view output using [snakeviz](https://pypi.org/project/snakeviz/):
306-
307-
```
308-
snakeviz "#examples_profile_5qubits_prof.prof"
309-
```
109+
For development guidelines please visit
110+
[Development](https://argmaster.github.io/cssfinder/latest/development/00_setup.md)
111+
in CSSFinder online documentation.

cssfinder/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def create_gilbert(
240240
"""
241241
state_config = config.get_state()
242242

243-
initial_state = asset_io.load_state(state_config.file)
243+
initial_state = asset_io.load_state(state_config.expanded_file)
244244

245245
if state_config.is_predefined_dimensions():
246246
depth = state_config.get_depth()

0 commit comments

Comments
 (0)