Skip to content

Commit

Permalink
Small cosmetic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Feb 11, 2023
1 parent 281000b commit 7e26c3d
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 30 deletions.
4 changes: 2 additions & 2 deletions PyPEEC/lib_matrix/matrix_gmres.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ def fct(res):
obj.get_callback(res)

# call the solver
logger.info("start solver")
logger.info("start matrix solver")
(sol, flag) = sla.gmres(
sys_op, rhs,
tol=rel_tol, atol=abs_tol,
restart=n_between_restart, maxiter=n_maximum_restart,
M=pcd_op, callback=fct, callback_type="pr_norm",
)
logger.info("exit solver")
logger.info("exit matrix solver")

# get the number of iterations
(n_iter, res_iter) = obj.get_n_iter()
Expand Down
2 changes: 1 addition & 1 deletion PyPEEC/lib_utils/plotgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This module is likely to break with newer/older versions of the dependencies.
WARNING: Making many plots can lead to segmentation fault with PyVista.
Not sure if the problem lies with PyVista or Vtk.
Not sure if the problem lies with PyPEEC, PyVista or Vtk.
"""

__author__ = "Thomas Guillod"
Expand Down
3 changes: 2 additions & 1 deletion PyPEEC/lib_utils/timelogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def get_logger(name):

# get the logger (only one logger per name is allowed)
logger = logging.getLogger(name)
assert len(logger.handlers) == 0, "duplicated logger name"
if len(logger.handlers) != 0:
raise RuntimeError("duplicated logger name")

# get the formatter
fmt = _DeltaTimeFormatter(
Expand Down
3 changes: 2 additions & 1 deletion PyPEEC/lib_visualization/manage_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
For the plotter, extract the material description.
For the plotter, compute the magnetic field for the point cloud.
WARNING: The magnetic field computation is only accurate far away from the source.
WARNING: The magnetic field computation is done with lumped variables.
Therefore, the computation is only accurate far away from the source voxels.
"""

__author__ = "Thomas Guillod"
Expand Down
2 changes: 1 addition & 1 deletion PyPEEC/lib_visualization/manage_matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def _get_plot_residuum(fig, res_raw):
"""
Plot the final residuum (absolute value) with an histogram.
Plot the final residuum (absolute value) with a histogram.
"""

# activate the figure
Expand Down
10 changes: 5 additions & 5 deletions PyPEEC/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def run_mesher(file_mesher, file_voxel):
Parameters
----------
file_mesher : string (input file, JSON format)
file_voxel : string (output file, pickle format)
file_voxel : string (output file, Pickle format)
Returns
-------
Expand Down Expand Up @@ -67,7 +67,7 @@ def run_viewer(file_voxel, file_point, file_viewer, is_interactive):
Parameters
----------
file_voxel : string (input file, pickle format)
file_voxel : string (input file, Pickle format)
file_point: string (input file, JSON format)
file_viewer: string (input file, JSON format)
is_interactive : boolean
Expand Down Expand Up @@ -106,9 +106,9 @@ def run_solver(file_voxel, file_problem, file_solution):
Parameters
----------
file_voxel : string (input file, pickle format)
file_voxel : string (input file, Pickle format)
file_problem: string (input file, JSON format)
file_solution: string (output file, pickle format)
file_solution: string (output file, Pickle format)
Returns
-------
Expand Down Expand Up @@ -145,7 +145,7 @@ def run_plotter(file_solution, file_point, file_plotter, is_interactive):
Parameters
----------
file_solution : string (input file, pickle format)
file_solution : string (input file, Pickle format)
file_point: string (input file, JSON format)
file_plotter: string (input file, JSON format)
is_interactive : boolean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The **PyPEEC** package contains the following tools:

* [**Gallery**](docs/gallery.md) - Gallery of screenshots
* [**Getting Started**](docs/tutorial.md) - Explanation of the workflow of PyPEEC
* [**Technical Details**](docs/technical.md) - Explanation of the dependencies, packing, and tests
* [**Technical Details**](docs/technical.md) - Explanation of the dependencies, packaging, and tests

## Screenshot

Expand Down
10 changes: 5 additions & 5 deletions docs/technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Moreover, the memory consumption is not heavily optimized (no customized garbage
## Tests

* The tests are located in the `tests` folder (using the `unittest` framework).
* Only integration tests currently exist (no unit tests).
* The tests are using the Python .
* * Only integration tests currently exist (no unit tests).
* The tests are just checking that the code is running with the examples.

# Warnings

Expand All @@ -45,7 +45,7 @@ Moreover, the memory consumption is not heavily optimized (no customized garbage
> **Warning**: For large problems, the code might allocate huge amount of memory.
> This might crash your operating system.
> **Warning**: Python pickle files are using to store the mesher and solver results.
> **Warning**: Python Pickle files are using to store the mesher and solver results.
> Pickling data is not secure.
> Only load pickle files that you trust.
> Do not commit the pickle files in the git repository.
> Only load Pickle files that you trust.
> Do not commit the Pickle files in the git repository.
4 changes: 2 additions & 2 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ The following files (JSON for inputs, pickle for outputs) are used:
* `file_point` (JSON, input file): definition of a point cloud for evaluating the magnetic field
* `file_viewer` (JSON, input file): options for the plots generated by the viewer
* `file_plotter` (JSON, input file): options for the plots generated by the plotter
* `file_voxel` (pickle, output file): file with the definition of the voxel structure
* `file_solution` (pickle, output file): file with the solution of the magnetic problem
* `file_voxel` (Pickle, output file): file with the definition of the voxel structure
* `file_solution` (Pickle, output file): file with the solution of the magnetic problem

## Examples

Expand Down
2 changes: 1 addition & 1 deletion examples/png_busbar/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/png_inductor/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/png_pcb/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/png_shield/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/png_wire/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/stl_inductor/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/stl_transformer/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/voxel_core/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/voxel_slab/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion examples/voxel_transformer/problem.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"condition_options": {
"check": true,
"tolerance": 1e12,
"tolerance": 1e15,
"norm_options": {
"t_accuracy": 2,
"n_iter_max": 25
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ scikit-umfpack>=0.3 # used by the solver, optional see config file
pyFFTW>=0.13 # used by the solver, optional see config file

# package for visualization
matplotlib>=3.6 # used by the viewer, and plotter
Pillow>=9.4 # used by the mesher
matplotlib>=3.6 # used by the viewer, and plotter
pyvista>=0.37 # used by the mesher, viewer, and plotter
pyvistaqt>=0.9 # used by the viewer, and plotter
QtPy>=2.3 # used by the viewer, and plotter
Expand Down

0 comments on commit 7e26c3d

Please sign in to comment.