Skip to content

Commit

Permalink
Hotfixes coverage (#18)
Browse files Browse the repository at this point in the history
* Fixing pipeline and README

* Moved utils to its own folder

Fixed imports
  • Loading branch information
JosePizarro3 authored Jun 10, 2024
1 parent cb6e9d3 commit 0b2c7f7
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Install dependencies
run: |
pip install uv
uv pip install coveralls --system
uv pip install '.[dev]' --system
- name: mypy
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Our CI/CD pipeline produces a more comprehensive test report using `coverage` an

```sh
uv pip install coverage coveralls
python -m pytest --cov=src tests
python -m pytest --cov=src tests
```

### Run linting and auto-formatting
Expand Down
2 changes: 1 addition & 1 deletion src/pyssmf/hopping_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np
import logging

from .schema import Model
from pyssmf.schema import Model


class Pruner:
Expand Down
4 changes: 2 additions & 2 deletions src/pyssmf/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from nomad.units import ureg

# NOMAD schema
from .schema import System, BravaisLattice, Model
from .utils import get_files
from pyssmf.schema import System, BravaisLattice, Model
from pyssmf.utils import get_files

re_n = r'[\n\r]'

Expand Down
12 changes: 6 additions & 6 deletions src/pyssmf/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import os
from scipy.stats import norm

from .input import ValidLatticeModels
from .schema import Model
from .parsing import MinimalWannier90Parser, ToyModels
from .hopping_pruning import Pruner
from .tb_hamiltonian import TBHamiltonian
from .visualization import plot_hopping_matrices, plot_band_structure, plot_dos
from pyssmf.input import ValidLatticeModels
from pyssmf.schema import Model
from pyssmf.parsing import MinimalWannier90Parser, ToyModels
from pyssmf.hopping_pruning import Pruner
from pyssmf.tb_hamiltonian import TBHamiltonian
from pyssmf.visualization import plot_hopping_matrices, plot_band_structure, plot_dos


class Runner(ValidLatticeModels):
Expand Down
3 changes: 2 additions & 1 deletion src/pyssmf/tb_hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

from nomad.atomutils import Formula
from nomad.units import ureg
from .schema import Model

from pyssmf.schema import Model


class KSampling:
Expand Down
17 changes: 17 additions & 0 deletions src/pyssmf/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright: Dr. José M. Pizarro.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .utils import get_files, extract_hdf5_dataset
File renamed without changes.
1 change: 0 additions & 1 deletion src/pyssmf/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#

import numpy as np
import PyQt5 # noqa: F401

import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
Expand Down

1 comment on commit 0b2c7f7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/pyssmf
   __init__.py220%17–18
   hopping_pruning.py36360%17–94
   input.py72720%17–188
   parsing.py1411410%17–267
   runner.py84840%17–210
   schema.py23230%17–163
   tb_hamiltonian.py77770%17–206
   visualization.py57570%17–153
src/pyssmf/utils
   __init__.py110%17
   utils.py21210%17–71
TOTAL5145140% 

Tests Skipped Failures Errors Time
5 0 💤 0 ❌ 0 🔥 0.287s ⏱️

Please sign in to comment.