Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPI-3688 Improved SP3 content writer tests, test data, header formatting correctness, and comment handling / passthrough options #73

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

treefern
Copy link
Collaborator

@treefern treefern commented Jan 17, 2025

Also:

  • Functions for formatting epoch row headers and SP3 header have been refactored, improving clarity and avoiding the need for trimming output before use.

…ne by line and display diffs of the incorrect lines
…ng at least the minimum number of comment lines are output. Also change minimal comment to fit the spec, which includes an extra space.
…t already set, as this is the version it outputs
…ines without newlines on them, but add these back in just before concatenating header output
…irst header line specification compliant. Update SP3 test data to match the SP3d spec regarding alignment of the Data Used field.
…o make things more general. Added specific wrapper function for SP3 header datetime formatting.
@treefern treefern requested a review from ronaldmaj January 17, 2025 07:43
@treefern treefern self-assigned this Jan 17, 2025
…ed to 6 chars as a way of adding leading whitespace, which was confusing)
@treefern treefern changed the title NPI 3688 Improved SP3 content writer tests, test data, formatting correctness, and comment handling options NPI 3688 Improved SP3 content writer tests, test data, header formatting correctness, and comment handling / passthrough options Jan 17, 2025
@treefern treefern changed the title NPI 3688 Improved SP3 content writer tests, test data, header formatting correctness, and comment handling / passthrough options NPI-3688 Improved SP3 content writer tests, test data, header formatting correctness, and comment handling / passthrough options Jan 17, 2025
@treefern treefern marked this pull request as ready for review January 30, 2025 10:57
Copy link
Collaborator

@ronaldmaj ronaldmaj left a comment

Choose a reason for hiding this comment

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

This is looking good and introduces some very handy functionality. Just a couple suggestions for type hints and unittests for new functions. If that is resolved, I think this can go in

def remove_offline_sats(sp3_df: _pd.DataFrame, df_friendly_name: str = ""):
def reflow_string_as_lines_for_comment_block(
comment_string: str, line_length_limit: int = SP3_COMMENT_MAX_LENGTH, comment_line_lead_in: str = SP3_COMMENT_START
) -> list[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

You will need to import List from typing (from typing import List) and use that rather than list

return output_lines


def get_sp3_comments(sp3_df: _pd.DataFrame) -> list[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above comment


def update_sp3_comments(
sp3_df: _pd.DataFrame,
comment_lines: Union[list[str], None] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Union[List[str]]

@@ -270,11 +275,71 @@ def mjd2j2000(mjd: _np.ndarray, seconds_frac: _np.ndarray, pea_partials=False) -
return datetime2j2000(datetime)


def j2000_to_igs_dt(j2000_secs: _np.ndarray) -> _np.ndarray:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably have unittests for this and the other functions as well? (including j2000_to_igs_epoch_row_header_dt and j2000_to_sp3_head_dt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants