_data/to_doi_csv.py
def mapping_func(data):
    """Maps simulation data to DOI data

    Args:
      data: the data to transform
    """
    def meta(data):
        """Return the metadata section
        """
        return data[1]['metadata']

    def keywords():
        """Common keywords for all simulations
        """
        return ["phase-field", "materials-science"]

    def urlbase():
        """The base URL for the simulation links.
        """
        return "https://pages.nist.gov/pfhub/simulations"

    return (
        data[0],
        dict(
            CreatorFN=meta(data)['author']['first'],
            CreatorLN=meta(data)['author']['last'],
            Title=data[0],
            PublicationYear=parse(meta(data)['timestamp']).strftime("%Y"),
            Location=os.path.join(urlbase(), data[0]),
            DOI="I WILL PROVIDE",
            ResourceType="Dataset/Benchmark",
            Subject=",".join(
                keywords() + [meta(data)["implementation"]["name"]]
            ),
            date=parse(meta(data)['timestamp']).strftime("%Y/%m/%d"),
            Language="en",
            AlternativeIdentifier=data[1]['benchmark']['id'],
            RelatedIdentifier="https://doi.org/10.18434/M32H3J",
            Format="application/x-yaml",
            Rights="I WILL PROVIDE",
            Summary=meta(data)["summary"]
        )
    )
Maps simulation data to DOI data

    Args:
      data: the data to transform
    
Maps simulation data to DOI data
Maps simulation data to DOI data
def mapping_func(data):
    def meta(data):
        return data[1]['metadata']
    def keywords():
        return ["phase-field", "materials-science"]
    def urlbase():
        return "https://pages.nist.gov/pfhub/simulations"
    return (
        data[0],
        dict(
            CreatorFN=meta(data)['author']['first'],
            CreatorLN=meta(data)['author']['last'],
            Title=data[0],
            PublicationYear=parse(meta(data)['timestamp']).strftime("%Y"),
            Location=os.path.join(urlbase(), data[0]),
            DOI="I WILL PROVIDE",
            ResourceType="Dataset/Benchmark",
            Subject=",".join(
                keywords() + [meta(data)["implementation"]["name"]]
            ),
            date=parse(meta(data)['timestamp']).strftime("%Y/%m/%d"),
            Language="en",
            AlternativeIdentifier=data[1]['benchmark']['id'],
            RelatedIdentifier="https://doi.org/10.18434/M32H3J",
            Format="application/x-yaml",
            Rights="I WILL PROVIDE",
            Summary=meta(data)["summary"]
        )
    )
def mapping_func ( data ) : def meta ( data ) : """Return the metadata section
        """ return data [ 1 ] [ 'metadata' ] def keywords ( ) : """Common keywords for all simulations
        """ return [ "phase-field" , "materials-science" ] def urlbase ( ) : """The base URL for the simulation links.
        """ return "https://pages.nist.gov/pfhub/simulations" return ( data [ 0 ] , dict ( CreatorFN = meta ( data ) [ 'author' ] [ 'first' ] , CreatorLN = meta ( data ) [ 'author' ] [ 'last' ] , Title = data [ 0 ] , PublicationYear = parse ( meta ( data ) [ 'timestamp' ] ) . strftime ( "%Y" ) , Location = os . path . join ( urlbase ( ) , data [ 0 ] ) , DOI = "I WILL PROVIDE" , ResourceType = "Dataset/Benchmark" , Subject = "," . join ( keywords ( ) + [ meta ( data ) [ "implementation" ] [ "name" ] ] ) , date = parse ( meta ( data ) [ 'timestamp' ] ) . strftime ( "%Y/%m/%d" ) , Language = "en" , AlternativeIdentifier = data [ 1 ] [ 'benchmark' ] [ 'id' ] , RelatedIdentifier = "https://doi.org/10.18434/M32H3J" , Format = "application/x-yaml" , Rights = "I WILL PROVIDE" , Summary = meta ( data ) [ "summary" ] ) )
Maps simulation data to DOI data
Maps simulation data to DOI data
"""Maps simulation data to DOI data

    Args:
      data: the data to transform
    """ """Return the metadata section
        """ """Common keywords for all simulations
        """ """The base URL for the simulation links.
        """
data
the data to transform
the data to transform