Skip to content

Commit

Permalink
reorganising module
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikLizakJohansen committed Sep 16, 2023
1 parent 41e0595 commit 9f343b2
Show file tree
Hide file tree
Showing 35 changed files with 440 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
**/*output/

figures/**/*.csv
quickstart/**/*.csv

*.psd
14 changes: 10 additions & 4 deletions DebyeCalculator/debye_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ def __init__(
self.biso = biso

# Initialise ranges
self.q = torch.linspace(self.qmin, self.qmax, int((self.qmax+self.qstep) / self.qstep)).unsqueeze(-1).to(device=self.device)
self.r = torch.linspace(self.rmin, self.rmax, int((self.rmax+self.rstep) / self.rstep)).unsqueeze(-1).to(device=self.device)
#self.q = torch.linspace(self.qmin, self.qmax-self.qstep, int((self.qmax+self.qstep) / self.qstep)).unsqueeze(-1).to(device=self.device)
#self.r = torch.linspace(self.rmin, self.rmax-self.rstep, int((self.rmax+self.rstep) / self.rstep)).unsqueeze(-1).to(device=self.device)
self.q = torch.arange(self.qmin, self.qmax, self.qstep).unsqueeze(-1).to(device=self.device)
self.r = torch.arange(self.rmin, self.rmax, self.rstep).unsqueeze(-1).to(device=self.device)

# Form factor coefficients
with open(pkg_resources.resource_filename(__name__, 'form_factor_coef.yaml'), 'r') as yaml_file:
Expand Down Expand Up @@ -141,8 +143,12 @@ def update_parameters(

# Re-initialise ranges
if np.any([k in ['qmin','qmax','qstep','rmin', 'rmax', 'rstep'] for k in kwargs.keys()]):
self.q = torch.linspace(self.qmin, self.qmax, int((self.qmax+self.qstep) / self.qstep)).unsqueeze(-1).to(device=self.device)
self.r = torch.linspace(self.rmin, self.rmax, int((self.rmax+self.rstep) / self.rstep)).unsqueeze(-1).to(device=self.device)
#self.q = torch.linspace(self.qmin, self.qmax-self.qstep, int(self.qmax / self.qstep)).unsqueeze(-1).to(device=self.device)
#self.r = torch.linspace(self.rmin, self.rmax-self.rstep, int(self.rmax / self.rstep)).unsqueeze(-1).to(device=self.device)
#self.q = torch.linspace(self.qmin, self.qmax-self.qstep, int((self.qmax+self.qstep) / self.qstep)).unsqueeze(-1).to(device=self.device)
#self.r = torch.linspace(self.rmin, self.rmax-self.rstep, int((self.rmax+self.rstep) / self.rstep)).unsqueeze(-1).to(device=self.device)
self.q = torch.arange(self.qmin, self.qmax, self.qstep).unsqueeze(-1).to(device=self.device)
self.r = torch.arange(self.rmin, self.rmax, self.rstep).unsqueeze(-1).to(device=self.device)

def _initialise_structures(
self,
Expand Down
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 9f343b2

Please sign in to comment.