Skip to content

Commit

Permalink
Fixed imports with new src/pyssmf structure
Browse files Browse the repository at this point in the history
Added missing dev dependencies
  • Loading branch information
JosePizarro3 committed May 28, 2024
1 parent 15259d6 commit 1e662fa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ dev = [
'pytest==3.10.0',
'ruff',
"structlog==22.3.0",
"lxml_html_clean>=0.1.0",
"PyQt5==5.15.10",
]

[tool.ruff]
Expand Down
10 changes: 5 additions & 5 deletions src/pyssmf/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, **kwargs):
Reads the input arguments and stores then in self.data in a JSON file generated
in the working_directory.
- 'logger': the logger where the errors, warnings, etc. will be printed.
- 'code': 'SSMF'.
- 'code': 'pySSMF'.
- 'working_directory': working directory where the files are located.
If 'read_from_input_file' is true:
- 'input_file': path to the input JSON file in the working directory.
Expand All @@ -64,7 +64,7 @@ def __init__(self, **kwargs):
"""
super().__init__()
# Initializing data
data = {'code': 'SSMF'}
data = {'code': 'pySSMF'}

# Check working_directory and stores it in data
if not kwargs.get('working_directory'):
Expand Down Expand Up @@ -158,7 +158,7 @@ def to_json(self):

def read_from_file(self, input_file: str) -> dict:
"""
Reads the input data from a JSON file provided it is a SSMF code input file.
Reads the input data from a JSON file provided it is a pySSMF code input file.
Args:
input_file (str): path to the input JSON file in the working directory.
Expand All @@ -180,9 +180,9 @@ def read_from_file(self, input_file: str) -> dict:
extra={'input_file': input_file},
)
code_name = input_data.get('code', '')
if code_name != 'SSMF':
if code_name != 'pySSMF':
self.logger.error(
'Could not recognize the input JSON file as readable by the SSMF code.',
'Could not recognize the input JSON file as readable by the pySSMF code.',
extra={'input_file': input_file},
)
return input_data
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytest
import numpy as np

from src.schema import System, BravaisLattice, Model
from pyssmf.schema import System, BravaisLattice, Model


def get_template_system():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hopping_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#

import numpy as np
from src.hopping_pruning import Pruner
from pyssmf.hopping_pruning import Pruner


def test_pruner(example_model):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import numpy as np
import os

from src.schema import Model
from src.parsing import MinimalWannier90Parser
from pyssmf.schema import Model
from pyssmf.parsing import MinimalWannier90Parser


def approx(value, abs=0, rel=1e-6):
Expand Down

0 comments on commit 1e662fa

Please sign in to comment.