Skip to content

Commit

Permalink
Created a temp value for metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Oct 24, 2024
1 parent 120fe41 commit 3390f86
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sasdata/temp_ascii_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from sasdata.data import SasData
from sasdata.quantities.units import NamedUnit
from sasdata.quantities.quantity import NamedQuantity
from sasdata.quantities.accessors import AccessorTarget, Group
from sasdata.metadata import Metadata
from enum import Enum
from dataclasses import dataclass
import numpy as np
Expand Down Expand Up @@ -68,7 +70,13 @@ def load_quantities(params: AsciiReaderParams) -> list[NamedQuantity]:
quantities = [NamedQuantity(name, arrays[i], unit) for i, (name, unit) in enumerate(params.columns)]
return quantities

def load_metadata(params: AsciiReaderParams):
root_group = Group('root', {})
metadata = Metadata(AccessorTarget(root_group))
# TODO: Actually fill this metadata in based on params.
return metadata

def load_data(params: AsciiReaderParams) -> SasData:
quantities = load_quantities(params)
# Name is placeholder; this might come from the metadata.
return SasData(params.filename, quantities, None)
return SasData(params.filename, quantities, load_metadata(params))

0 comments on commit 3390f86

Please sign in to comment.